4 ms·
This is kind of misleading. grep has an option to enable PCRE matching (the -P flag), but it by default still uses a combination of Boyer-Moore, Commentz-Walter
by burntsushi 11y ago
This is kind of misleading. grep has an option to enable PCRE matching (the -P flag), but it by default still uses a combination of Boyer-Moore, Commentz-Walter (like Aho-Corasick) and a lazy DFA.
Also, Rust's regex engine (which is based on a lazy DFA) is giving PCRE2's JIT a run for its money. ;-) https://gist.github.com/anonymous/14683c01993e91689f7206a18675901b#file-pcre2-rust https://gist.github.com/anonymous/14683c01993e91689f7206a186...
- lgunsch 11y agoAh, okay. I didn't realize that. I was trying to point out there are everyday valid use cases for JIT that don't involve the JVM. I've used Rust's regex engine before, it's very promising. It's really neat how the regex itself is fully compiled.
- burntsushi 11y agoYeah, you're absolutely right to point out PCRE2's JIT. It is indeed quite fast---I'm not entirely convinced a DFA approach can beat it in every case!