5 ms·
I don't doubt that HyperScan ends up being a better fit for you, but it's not strictly true that RE2 can't tell you about multi-pattern matching. https://githu
by rsc 11y ago
I don't doubt that HyperScan ends up being a better fit for you, but it's not strictly true that RE2 can't tell you about multi-pattern matching.
https://github.com/google/re2/blob/master/re2/set.h https://github.com/google/re2/blob/master/re2/set.h
- glangdale 11y agoThis is true. One question I've always had about RE2's set interface: if I remember correctly, it reports only true/false for whether the input matches each regex but not number of matches or start and/or end offsets of the matches. Is this an essential feature of the implementation (e.g. necessary for an efficient DFA implementation of typical patterns) or a quirk of the API? We have perennial problems with "match flooders" that, once they start matching, throw great scads of matches (especially when, given our all-matches semantics, a trailing construct like .* means 'just keep throwing matches for ever). I've often wondered whether the RE2 set interface was influenced by the same problem.