You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A 2024 POPL paper proposed a new NFA-based algorithm for matching regular expressions with arbitrary lookaround in O(m * n) time, without the previously-required exponential blowup in automaton size or matching time: https://dl.acm.org/doi/10.1145/3632934
Its main limitation is that, for regular expressions with both lookahead and lookbehind, it no longer supports streaming, because each form of lookaround involves a pass from its associated direction, and an O(n) buffer to hold the results. (With only one or the other, everything can be done in one pass and without the buffer.)
They show some pretty competitive benchmarks with PCRE2 and Java's regex engine as well.
I don't personally have a way to judge how worthwhile this would be, but I thought you would be interested to hear about it in any case!
This discussion was converted from issue #1152 on January 19, 2024 12:42.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
A 2024 POPL paper proposed a new NFA-based algorithm for matching regular expressions with arbitrary lookaround in O(m * n) time, without the previously-required exponential blowup in automaton size or matching time: https://dl.acm.org/doi/10.1145/3632934
Its main limitation is that, for regular expressions with both lookahead and lookbehind, it no longer supports streaming, because each form of lookaround involves a pass from its associated direction, and an O(n) buffer to hold the results. (With only one or the other, everything can be done in one pass and without the buffer.)
They show some pretty competitive benchmarks with PCRE2 and Java's regex engine as well.
I don't personally have a way to judge how worthwhile this would be, but I thought you would be interested to hear about it in any case!
Beta Was this translation helpful? Give feedback.
All reactions