3 ms·
You can use re2 in Ruby if you like - it's just not the default. https://github.com/mudge/re2 https://github.com/mudge/re2 best solution is to have an impl
by JohnBooty 5y ago
You can use re2 in Ruby if you like - it's just not the default. https://github.com/mudge/re2 https://github.com/mudge/re2
best solution is to have an implementation like re2 that does not have those problems.
By design RE2 isn't fully compatible with Onigmo. As another poster mentioned, a hybrid "use RE2 when possible; fall back to Onigmo otherwise" approach was considered and rejected for well-explained reasons https://bugs.ruby-lang.org/issues/18653 https://bugs.ruby-lang.org/issues/18653
Maybe in addition to `Regexp.timeout = 1.0` there could also be a `Regexp.parser = :re2` option with `:onigmo` being the default.