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.
C++ Python Makefile Perl CMake Shell Batchfile
Latest commit 20f9edd Jan 12, 2017 @junyer junyer Oops, fix the bug in StringPiece::compare().
Change-Id: Icfb03804a83ed2a8fd693baebf9c88562ae8094a
Reviewed-by: Paul Wankadia <>
Failed to load latest commit information.
benchlog benchlog: Add gnuplot support Jul 17, 2015
doc Update Unicode data to 8.0.0. Jan 31, 2016
kokoro Flatten the kokoro/ directory structure. (2 of 2) Nov 22, 2016
lib/git Cleanup: Remove hg codereview extension. Apr 9, 2015
re2 Oops, fix the bug in StringPiece::compare(). Jan 12, 2017
util Ignore -Wmisleading-indentation in util/ only. Sep 28, 2016
.gitignore re2: exclude benchlog results in .gitignore Jul 10, 2015
AUTHORS re2: make tables const Jan 10, 2014
BUILD Correctly set testonly to test targets Oct 24, 2016
CMakeLists.txt The DLL conventionally goes into the bin/ directory. Nov 15, 2016 re2: more Gerrit+GitHub integration Nov 20, 2014
CONTRIBUTORS Remove comparisons of this with NULL. Jun 26, 2014
LICENSE initial release Mar 3, 2010
Makefile Change two uses of LOG(FATAL) to LOG(DFATAL) or DCHECK. Sep 6, 2016
README Mention the R wrapper in the README file. Aug 12, 2016
WORKSPACE Add a workspace name based on Bazel guidelines Jul 1, 2016
libre2.symbols Make the re2_dfa_bail_when_slow knob not a flag. Sep 2, 2016
libre2.symbols.darwin Make the re2_dfa_bail_when_slow knob not a flag. Sep 2, 2016
re2.pc Plumb more variables from Makefile to re2.pc. May 9, 2016
re2_test.bzl Remove includes attributes that will break the build. Apr 14, 2016
runtests Make the dynamic binary tests work on Darwin. Sep 12, 2016 Get rid of using-directives. Aug 7, 2016
ucs2.diff add ucs2.diff, showing old UCS-2 support Feb 7, 2012


This is the source code repository for RE2, a regular expression library.

For documentation about how to install and use RE2,

The short version is:

make test
make install
make testinstall

There is a fair amount of documentation (including code snippets) in
the re2.h header file.

More information can be found on the wiki:

Issue tracker:

Mailing list:

Unless otherwise noted, the RE2 source files are distributed
under the BSD-style license found in the LICENSE file.

RE2's native language is C++.

A C wrapper is at
An Erlang wrapper is at
An Inferno wrapper is at
A Node.js wrapper is at and on NPM.
An OCaml wrapper is at and on OPAM.
A Perl wrapper is at and on CPAN.
A Python wrapper is at
An R wrapper is at
A Ruby wrapper is at