7 ms·
> wrote the defacto standard regex library in Rust What is the motivation that Rust invented its own RegEx flavor instead of sticking to PCRE or even RE2?
by bashkiddie 6mo ago
> wrote the defacto standard regex library in Rust
What is the motivation that Rust invented its own RegEx flavor instead of sticking to PCRE or even RE2?
- VorpalWay 6mo agoNot going with a dialect that supports back references ensures that you have can have linear complexity, which is important for some use cases. PCRE doesn't fot that. Not sure about RE2, I have never used that. Other than that it is standard regex syntax pretty much as far as I know? One library is pretty much like another. What differs is mostly availability of some less used extensions, and performance characteristics. If you accept untrusted regexes you want one with linear time complexity. On top of that the rust regex engine has really good performance when it comes to the constants too (not just the big O notation).