google/re2j
linear time regular expression matching in Java observed · 2026-08-28
Health v2 · maintenance only
60/100
- Activity 83
- Release rhythm 8
- Longevity 100
Flags: no_license
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 4215
- days_rel: 601
- days_push: 103
- n_releases_24m: 1
Adoption not part of the score
1255 stars · 162 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
RE2/J is a pure Java port of Google's RE2 regular expression engine that guarantees linear-time matching using a nondeterministic finite automaton. It protects applications from catastrophic backtracking (ReDoS) when evaluating regex patterns, especially those from untrusted sources.
Use cases
- prevent regex denial of service from user-supplied patterns
- match regular expressions in linear time on large inputs
- replace java.util.regex for patterns with heavy alternation
- safely evaluate untrusted regex patterns in a web application
- avoid exponential backtracking in Java regex matching
When to choose
- your patterns have deep alternation and java.util.regex may backtrack exponentially
- you accept regex patterns from untrusted users and need ReDoS protection
- you need predictable worst-case matching time on large inputs
When to avoid
- you rely on backreferences or PCRE-specific features
- you need a drop-in java.util.regex replacement with full API parity
- you use flags like CANON_EQ, COMMENTS, or UNICODE_CASE
Facets
library · maturity active
parser security parsers security developer-tools jvm regex re2 linear-time regex-dos pure-java
1 source
- readme: https://github.com/google/re2j · fetched 2026-08-28 · b05c7d28f34b
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| google/re2j | main | 60 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem