mcpp index

compat.re2

#include

RE2 — fast, safe, thread-friendly regular expression engine (static)

#include "re2/re2.h"
mcpp add compat.re2@2022-04-01

Usage

From this repository's own test project — built and run by CI, not written for the website.

// Behavioral test for compat.re2.
//
// Exercises the parts of RE2 that gRPC's xds matchers actually use — full and
// partial match with captures, a pre-compiled RE2 object, replacement, and the
// RE2::Set multi-pattern API — so a package that compiled but linked nothing
// useful cannot pass:
//
//   RE2 ctor / FullMatch / PartialMatch  -> re2/re2.cc, parse.cc, compile.cc, prog.cc
//   captures + rewriting                 -> re2/re2.cc, regexp.cc, simplify.cc
//   RE2::Set                             -> re2/set.cc, dfa.cc, nfa.cc
//   invalid pattern reporting            -> re2/parse.cc, tostring.cc
//   UTF-8 handling                       -> util/rune.cc, unicode_groups.cc
//
// Returns non-zero on any mismatch.
#include <string>
#include <vector>

#include "re2/re2.h"
#include "re2/set.h"

namespace {

// …

tests/examples/re2/tests/match.cpp · project tests/examples/re2

Build

targets
re2 (lib)
language
c++23
import std
no
include dirs
*

Sources (3)

  • */re2/*.cc
  • */util/rune.cc
  • */util/strutil.cc

Versions

VersionPlatforms Mirrorssha256
2022-04-01 latest LinuxWindowsmacOS CN GLOBAL 1ae8ccfdb106…