talira

Compare

RE2re2
What it isA fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and PythonSafer regular expressions in Ruby
KindOpen sourceOpen source
Trust0.420.28
Stars——
Last commit——
LicenceBSD-3-ClauseBSD-3-Clause
PricingFree and open sourceFree and open source
Free tierYesYes
Self-hostableYesYes
Ways to run it——
SOC 2——
HIPAA——
SSO——
APIYesYes
Plugins——
MCP server——
CompanyGoogle
public company (NASDAQ:GOOGL)
—
Features
  • match time linear in the length of the input
  • configurable memory budget for parsing, compiling and matching
  • no recursion, so no stack overflow
  • Perl-mode and POSIX-mode syntax
  • FullMatch and PartialMatch
  • submatch extraction into strings, integers and string views
  • precompiled RE2 objects for reuse
  • UTF-8 and Latin-1 input
  • All 11 features
  • full_match? and partial_match? with MatchData submatches
  • named capturing groups
  • lazy scanning with RE2::Scanner
  • RE2::Set to match many patterns at once
  • replace, global_replace, extract and escape
  • UTF-8 and ISO-8859-1 modes
  • precompiled native gems for Linux (glibc and musl), macOS and Windows
  • vendored RE2 and Abseil, or system libraries
  • All 9 features
Limitations
  • No backreferences or look-around assertions: RE2 leaves out constructs that only backtracking engines can implement
  • No Unicode normalization: patterns and text are matched by code point, so both must be normalized first if needed
  • No possessive quantifiers or atomic groups: the Syntax page marks them, and \Z and \G, as not supported
  • Only UTF-8 and ISO-8859-1 strings: behaviour with any other encoding is undefined, and inputs aren't converted for you
  • No backreferences or look-around assertions: RE2 leaves out constructs that only backtracking engines can implement