4 ms·
I seriously doubt regex with grouping, greediness and repetition exhibit the temporal properties of purely linear character-by-character matches...
by contingencies 12y ago
I seriously doubt regex with grouping, greediness and repetition exhibit the temporal properties of purely linear character-by-character matches...
- coldtea 12y agoDoesn't have to exhibit "the temporal properties of purely linear character-by-character matches" and noone said that strawman. It just has to exhibit the "correct matching strings return faster" property, whatever more complicated search it does.
- contingencies 12y agoDoesn't it have to exhibit "correctly matching strings return faster ... on a per-character or other tiny chunk basis" in order to work the match towards correctness?
- coldtea 12y agoYes, and it will indeed try by all means to exhibit that behavior -- unless if it's some contrived regex designed to counter this. The key word here is "short cirtuit" the match, and any regex engine worth its salt will try to do that as much as possible, tranforming the regex to the faster FSM it can.