3 ms·
Backreferences are not part of the original regular expression theories. Regular expressions are supposed to be equivalent to DFAs, but backrefs upgrade their s
by conradludgate 2y ago
Backreferences are not part of the original regular expression theories. Regular expressions are supposed to be equivalent to DFAs, but backrefs upgrade their status to full Turing machines.
Algorithms for running regexes as non-deterministic finite automata just happen to be easy to add backrefs too, but it completely breaks the DFA principle.
Interesting video on "How regexes got catastrophic": https://youtu.be/gITmP0IWff0 https://youtu.be/gITmP0IWff0