nitely / regexy

:wavy_dash: Linear time regex matching supporting streams and other goodies
MIT License
9 stars 1 forks source link

extract() #5

Open nitely opened 7 years ago

nitely commented 7 years ago

One of the best thing about this lib is the matching on streams. However, capturing may take as much RAM as the full data itself, therefore rendering the matching stream useless. extract() would return an iterator that would yield capturing groups as soon as there is one available. But I'm not quite sure how to implement this. As long as there is more than one state matched then there is no way to know which one will contain the right captured data. One way may be keeping the captured data until there is just one current match and then yielding :thinking: