4 ms·
Also: * Named groups are not supported everywhere. * Lookahead/lookbehind are not supported in Go and Rust (unless using fancy-regexp, from what I understand)
by slimsag 5y ago
Also:
* Named groups are not supported everywhere.
* Lookahead/lookbehind are not supported in Go and Rust (unless using fancy-regexp, from what I understand)
Also beware that character classes like `[]` have differing Unicode support, some operate on ASCII, unicode codepoints, or on extended grapheme clusters.. so YMMV.
As you start to expand to more languages, the common feature set is _far_ more limited.
- vbezhenar 5y agoLookbehind is not supported in Safari: https://caniuse.com/?search=lookbehind%20regex https://caniuse.com/?search=lookbehind%20regex
- slimsag 5y agoWow, I didn't know that - surprising!
- ridiculous_fish 5y agoLookbehinds are annoying to implement, because they require driving the character iteration backwards. Now every regex construct has to be parametrized on whether it is tracking forwards or backwards. It is not something which can be easily tacked on to an existing engine. I will plug my own Rust regex engine "regress", which supports arbitrary lookbehinds. Note fancy-regex only supports fixed-width lookbehinds. https://crates.io/crates/regress https://crates.io/crates/regress