Ruby bindings to RE2, a "fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python".
Why do you think that https://github.com/ankane/the-ultimate-guide-to-ruby-timeouts is a good alternative to re2