API reference#

Signatures, parameters and returns render from the header comments (Breathe) and the binding’s docstrings (autodoc), never hand-transcribed. These pages arrange that matter by task and add the guarantees and tested examples. The exhaustive Doxygen tree has every symbol, including internals:

Browse the full Doxygen reference (/api).

Which type#

I want to…

Type

Page

Compile a pattern and search

real::regex

basic_regex

Put the pattern in the type (constexpr, no heap)

real::static_regex

basic_regex

Know which of N patterns matched

real::regex_set

regex_set

Tokenize: longest match wins

real::dfa

dfa

Read groups and offsets

real::match_result

basic_match_result

Pattern syntax#

  • The pattern language itself – every construct and what it means, shared by all surfaces: Pattern syntax.

C++ core#

  • Match, search, anchormatch() / fullmatch() / search() on basic_regex.

  • Iterate every matchfind_iter(), a lazy range.

  • Count without allocatingcount_matches().

  • Replace or splitreplace() / split().

  • Flags, the pattern literal, the exception – the auxiliary types: Support types.

Compatibility shims (C++)#

  • The ``std::regex`` facebasic_regex, the regex_match family, match_results, the iterators: compat-std.

  • The RE2 faceRE2 and RE2::Set: compat-re2.

Python binding#

The re-compatible package, rendered from its docstrings: Python API.

Rust & Go bindings#

Drop-in layers#

Migrating from std::regex, RE2, Python re, Rust regex or Go regexp? The Drop-in section documents each layer’s API, divergences and limits.