A "nice to have" feature would be the ability to apply quantifiers to groups and not just individual characters/classes/sets. Probably not possible without a new MatchState (MatchStateE for Enhanced?) that has space to track backtracking points.
The current code uses recursive calls over the match function to handle backtracking (match returns NULL on no match, which either unwinds the stack all the way to signal no match at all or is caught somewhere down the stack by a caller that performs the backtracking and makes another recursive call). However, the quantifiers handle all their matches with only one recursive call, adding or subtracting another character each time NULL is returned. Here, each iteration could match different characters and a different number of bytes, so doing it that way would require a separate recursive call for each match, easily triggering a stack overflow.
Need to study the code for Python's re module here to understand how the matching works there; that would probably help a lot here.
A "nice to have" feature would be the ability to apply quantifiers to groups and not just individual characters/classes/sets. Probably not possible without a new MatchState (
MatchStateEfor Enhanced?) that has space to track backtracking points.The current code uses recursive calls over the
matchfunction to handle backtracking (matchreturnsNULLon no match, which either unwinds the stack all the way to signal no match at all or is caught somewhere down the stack by a caller that performs the backtracking and makes another recursive call). However, the quantifiers handle all their matches with only one recursive call, adding or subtracting another character each timeNULLis returned. Here, each iteration could match different characters and a different number of bytes, so doing it that way would require a separate recursive call for each match, easily triggering a stack overflow.Need to study the code for Python's
remodule here to understand how the matching works there; that would probably help a lot here.