3 ms·
Mathematically, regular expressions are limited in comparison to what are commonly called 'regular expressions' or 'regexes' by programmers. Mathematical regula
by brudgers 12y ago
Mathematically, regular expressions are limited in comparison to what are commonly called 'regular expressions' or 'regexes' by programmers. Mathematical regular expressions can be translated into automata, 'Regex style regular expressions' often cannot.
The advantage of mathematical regular expressions is that they terminate in O(n) time based on the length of the input string. The disadvantage is that they lack features like capture groups and look ahead/behind. The important point is that engines like those of Perl or Java are not based on regular expressions in a mathematical sense. This is true of any Regex engine that stores state or backtracks.