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. This is the source code repository for RE2, a regular expression library. There is a fair amount of documentation (including code snippets) in the re2.h header file. Unless otherwise noted, the RE2 source files are distributed under the BSD-style license found in the LICENSE file. In POSIX mode, RE2 accepts standard POSIX (egrep) syntax regular expressions. In Perl mode, RE2 accepts most Perl operators. The only excluded ones are those that require backtracking (and its potential for exponential runtime) to implement. These include backreferences (submatching is still okay) and generalized assertions. The Syntax page documents the supported Perl-mode syntax in detail. The default is Perl mode. The constructor takes an optional second argument that can be used to change RE2's default options.

Features

  • You can declare your own RE2::Options object and then configure it as you like
  • RE2 operates on Unicode code points
  • It makes no attempt at normalization
  • Construct your own argument lists
  • Use RE2 as a lexer, or parsing hex, octal, and C-radix numbers
  • RE2 accepts standard POSIX (egrep) syntax regular expressions

Project Activity

See All Activity >

Categories

Libraries

License

BSD License

Follow re2

re2 Web Site

Other Useful Business Software
Forever Free Full-Stack Observability | Grafana Cloud Icon
Forever Free Full-Stack Observability | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of re2!

Additional Project Details

Programming Language

C++

Related Categories

C++ Libraries

Registered

2021-09-13