# google/re2

RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library.

Repository: https://github.com/google/re2
Canonical: https://ross.abutalabs.com/products/re2
Language: C++
License: BSD-3-Clause
License Family: permissive
Last push: 2026-01-22T23:28:54+00:00

## Health v2 (maintenance only)
Score: 68/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 63, release rhythm 55, longevity 100
- inputs: {"age_days": 4398, "days_push": 223, "days_rel": 301, "gap_med": 10.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 9785, forks 1241 (observed 2026-08-28T04:10:37.139638+00:00)

## What it is
RE2 is a C++ regular expression library that guarantees linear-time matching, making it safe for handling regexes from untrusted users. It uses automata-based engines instead of backtracking, avoiding exponential runtime and stack overflow, at the cost of not supporting backreferences or look-around.

## Use cases
- match user-supplied regex patterns safely without denial-of-service risk
- run regex matching in multithreaded C++ services
- replace PCRE where exponential backtracking is a security concern
- parse and extract substrings from large text volumes with predictable performance
- limit memory usage when compiling untrusted regular expressions

## When to choose
- you need guaranteed linear match time on untrusted input
- you want thread-friendly regex matching without locks
- you need bounded memory usage and no stack overflow risk
- you don't need backreferences or look-around assertions

## When to avoid
- you rely on backreferences or look-around constructs
- you need full Perl/PCRE feature compatibility
- your patterns are simple and a backtracking engine is fast enough

## Facets
- artifact type: library
- maturity: stable
- function: parser, search-engine
- domain: parsers, developer-tools
- platform: cpp, cross-platform
- tags: regex, regular-expressions, linear-time-matching, text-processing, dfa, algorithms

## Member repositories
- google/re2 (main) score 68

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:37.139638+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:21:01.571343+00:00, confidence not recorded.
  - readme: https://github.com/google/re2 (fetched 2026-08-28T04:10:37.139638+00:00, sha 484d13d591e5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
