4 ms·
I don't quite understand this comment. Isn't a regular expression just a description of a custom finite state machine? Any fast regex implementation will first
by tdeck 11y ago
I don't quite understand this comment. Isn't a regular expression just a description of a custom finite state machine? Any fast regex implementation will first compile the pattern into a custom DFA before matching it.
- burntsushi 11y agoBy my count, most "regex" engines implement things more powerful than regular expressions. I'd say the majority of regex engines use backtracking instead of a DFA. Backtracking does tend to be slower in my experience, but PCRE2's JIT is definitely competitive with even the fastest DFA engines in my experience.