RE2 (software)
| RE2 | |
|---|---|
| Original author | |
| Initial release | March 11, 2010 |
| Stable release | 2021-04-01
/ August 12, 2025 |
| Written in | C++ |
| Operating system | Cross-platform |
| Type | Regular expression library |
| License | BSD |
| Website | github |
| Repository | github Pull requests: code-review |
RE2 is a C++ software library which implements a regular expression engine. It uses finite-state machines, in contrast to most other regular expression libraries. RE2 requires a minimum C++ version of C++17, and uses the Abseil library by Google.
RE2 was implemented by Google and Google uses RE2 for Google products. RE2 uses an "on-the-fly" deterministic finite-state automaton algorithm based on Ken Thompson's Plan 9 grep. It is designed to avoid ReDoS (regex denial of service) attacks.