|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
Namespaces | |
| namespace | compat |
| namespace | detail |
Classes | |
| class | basic_match_iterator |
| Forward iterator over the non-overlapping matches in a text. More... | |
| class | basic_match_range |
A range of matches, returned by find_iter() and usable in range-for. More... | |
| class | basic_match_result |
| The result of a match attempt: success, spans and captures. More... | |
| class | basic_regex |
| A compiled regular expression, parameterized on its storage policy. More... | |
| class | dfa |
| A maximal-munch DFA over an ordered set of patterns. More... | |
| class | dfa_error |
| Thrown when a pattern cannot be represented as a DFA. More... | |
| struct | dfa_match |
| The outcome of dfa::match — which rule won, and how many bytes it spans. More... | |
| struct | fixed_string |
| A fixed-size string usable as a non-type template parameter. More... | |
| class | regex_error |
Typedefs | |
| using | match_result = basic_match_result< std::vector< std::size_t > > |
The result type of the default, runtime-compiled real::regex. | |
| using | regex = basic_regex< detail::dynamic_storage > |
| The runtime-compiled regex type — the primary entry point. | |
| template<fixed_string Pattern, flags F = flags::none> | |
| using | static_regex = basic_regex< detail::static_storage< Pattern, F > > |
| A fully compile-time regex. | |
Enumerations | |
| enum class | flags : std::uint8_t { none = 0 , icase = 1 , multiline = 2 , dotall = 4 , bytes = 8 , verbose = 16 , ecma = 32 , ascii = 64 , dollar_endonly = 128 } |
Compilation flags, mirroring Python's re.I, re.M and re.S. More... | |
| enum class | match_semantics : std::uint8_t { first = 0 , longest = 1 } |
| Which match a search returns among those starting at the leftmost position (an experimental, opt-in, off-by-default engine mode — the default is unchanged). More... | |
| enum class | error_kind : std::uint8_t { syntax , unsupported } |
| Exception thrown for an invalid pattern (or one exceeding a limit). More... | |
Functions | |
| constexpr flags | operator| (flags lhs, flags rhs) |
| Bitwise-OR of two flag sets. | |
| constexpr flags | operator& (flags lhs, flags rhs) |
| Bitwise-AND of two flag sets. | |
| constexpr bool | has_flag (flags value, flags flag) |
Tests whether flag is set in value. | |
Variables | |
| constexpr std::size_t | npos {std::numeric_limits<std::size_t>::max()} |
| Sentinel for "no position" / unset capture slot (akin to std::string::npos). | |
| using real::match_result = typedef basic_match_result<std::vector<std::size_t> > |
The result type of the default, runtime-compiled real::regex.
| using real::regex = typedef basic_regex<detail::dynamic_storage> |
| using real::static_regex = typedef basic_regex<detail::static_storage<Pattern, F> > |
A fully compile-time regex.
The pattern is parsed, compiled and exactly sized at compile time; matching allocates nothing and also works in a constexpr context. An invalid pattern is a compile error.
| Pattern | The pattern, as a fixed_string literal. |
| F | Compilation flags. |
|
strong |
Exception thrown for an invalid pattern (or one exceeding a limit).
In a constexpr context (static_regex), reaching the throw is a compile-time error, with the message appearing in the diagnostic trace.
Whether a rejected pattern is malformed (syntax) or well-formed but beyond REAL's linear engine (unsupported: a backreference, \p{…}, a nested/unbounded lookaround). The distinction is a stable, machine-readable classification the C ABI exposes so a binding never has to grep what().
| Enumerator | |
|---|---|
| syntax | |
| unsupported | |
Definition at line 107 of file program.hpp.
|
strong |
Compilation flags, mirroring Python's re.I, re.M and re.S.
Combinable with operator|. Case folding is ASCII-only, consistent with the library's character-class semantics.
| Enumerator | |
|---|---|
| none | No flags. |
| icase | Case-insensitive (ASCII). |
| multiline |
|
| dotall |
|
| bytes | Binary mode: |
| verbose | Verbose mode ( |
| ecma | ECMAScript compatibility: |
| ascii | ASCII mode ( |
| dollar_endonly |
|
Definition at line 41 of file program.hpp.
|
strong |
Which match a search returns among those starting at the leftmost position (an experimental, opt-in, off-by-default engine mode — the default is unchanged).
Definition at line 56 of file program.hpp.
Tests whether flag is set in value.
| [in] | value | The flag set to query. |
| [in] | flag | The single flag to look for. |
true if flag is present in value. Definition at line 92 of file program.hpp.
Bitwise-AND of two flag sets.
| [in] | lhs | First flag set. |
| [in] | rhs | Second flag set. |
lhs and rhs. Definition at line 80 of file program.hpp.
Bitwise-OR of two flag sets.
| [in] | lhs | First flag set. |
| [in] | rhs | Second flag set. |
lhs and rhs. Definition at line 68 of file program.hpp.
|
inlineconstexpr |
Sentinel for "no position" / unset capture slot (akin to std::string::npos).
Definition at line 33 of file program.hpp.