RE2 (software)

RE2
Original authorGoogle
Initial releaseMarch 11, 2010 (2010-03-11)
Stable release
2021-04-01 / August 12, 2025 (2025-08-12)
Written inC++
Operating systemCross-platform
TypeRegular expression library
LicenseBSD
Websitegithub.com/google/re2
Repositorygithub.com/google/re2
Pull requests: code-review.googlesource.com

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.