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.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 30 minutes ago
Added to GitGenius on September 6th, 2026
Created on August 18th, 2014
Open Issues & Pull Requests: 64 (+0)
GitHub issues: Enabled
Number of forks: 1,243
Total Stargazers: 9,799 (+0)
Total Subscribers: 231 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

RE2 is a C++ library that provides a fast, safe, and thread-friendly regular expression engine.

Traditional backtracking regex engines like those in PCRE, Perl, and Python can suffer from catastrophic backtracking, where certain patterns cause exponential time complexity and potential denial-of-service vulnerabilities. RE2 solves this by using finite automata instead of backtracking, guaranteeing linear time matching regardless of input or pattern complexity. This approach trades some features—notably backreferences and lookahead assertions—for predictable performance and safety.

Developers should choose RE2 when working in C++ and prioritizing performance guarantees and thread safety over regex feature completeness. It suits systems where untrusted regex patterns might be supplied by users, where matching latency must be bounded, or where regex operations run in concurrent environments. Projects that require backreferences or advanced assertions will need to accept the limitations or use a different engine.

The project maintains a steady stream of commits addressing bug fixes and incremental improvements. Pull requests receive thoughtful review with discussion of design tradeoffs and edge cases. The maintainers respond to issues with technical depth, often explaining the reasoning behind design decisions and the constraints imposed by the finite automata approach. Documentation is thorough, including detailed explanations of what features are unsupported and why.