|
| | basic_regex ()=default |
| |
| | basic_regex (const CharT *pattern, flag_type f=regex_constants::ECMAScript, policy pol=policy::strict) |
| |
| | basic_regex (const string_type &pattern, flag_type f=regex_constants::ECMAScript, policy pol=policy::strict) |
| |
| | basic_regex (const CharT *pattern, std::size_t len, flag_type f=regex_constants::ECMAScript, policy pol=policy::strict) |
| |
| template<typename It > |
| | basic_regex (It begin, It end, flag_type f=regex_constants::ECMAScript, policy pol=policy::strict) |
| |
| std::size_t | mark_count () const noexcept |
| | Number of marked sub-expressions (excluding group 0), as std::basic_regex.
|
| |
| flag_type | flags () const noexcept |
| | The flags this regex was built with.
|
| |
| void | swap (basic_regex &other) noexcept |
| |
| bool | uses_real () const noexcept |
| | True if this regex is backed by the real engine (vs the std fallback).
|
| |
| bool | uses_fallback () const noexcept |
| | True if this regex fell back to std::regex (a policy::fallback regex on an ineligible pattern) — so this pattern is not linear-time / ReDoS-safe. Always false under strict.
|
| |
| compat::policy | policy () const noexcept |
| | The drop-in policy this regex was constructed with.
|
| |
| const std::variant< std::basic_regex< CharT, Traits >, real::regex > & | engine () const noexcept |
| | Access the active backend (engine-facing; used by the free functions).
|
| |
| bool | nullable () const noexcept |
| | Whether the pattern can match the empty string (real's empty_match_possible hint).
|
| |
| bool | posix_longest () const noexcept |
| | Whether this is a POSIX-ERE pattern routed to REAL: search/match must use leftmost-**longest** bounds (the POSIX semantics), not the default leftmost-first. Set only for a translated extended.
|
| |
| bool | uses_real_traversal () const noexcept |
| | Whether replace/iterate run on the real traversal (real-backed AND non-nullable). A nullable pattern delegates replace/iterate to std (the empty-match traversal differs; and iterating a nullable pattern whose per-position match cost is O(n) is O(n²) on any linear engine, so routing it buys correctness but not a linear guarantee — see the nullable note in COMPATIBILITY.md).
|
| |
| const std::basic_regex< CharT, Traits > & | std_engine () const |
| | The std::regex for the std / lazy-std path (built once on demand for a real-backed pattern reached via a constraining flag / nullable replace-iterate / $0/sed replace).
|
| |
template<typename CharT = char, typename Traits = std::regex_traits<CharT>>
class real::compat::basic_regex< CharT, Traits >
A std::basic_regex-compatible pattern, backed by real where proven, else std.
- Template Parameters
-
| CharT | Character type (char; other types route straight to std). |
| Traits | Regex traits (std parity). |
Definition at line 579 of file regex_core.hpp.
template<typename CharT = char, typename Traits = std::regex_traits<CharT>>
Whether the pattern can match the empty string (real's empty_match_possible hint).
Empty-match traversal (replace / iterate) follows Python's advance rules in real, which differ from ECMAScript. So a nullable real-backed pattern routes those operations to a lazily built std::regex (std_engine) — per operation, not at construction, so search/match keep real's linear-time guarantee even on nullable-ReDoS patterns like (a*)*.
Definition at line 680 of file regex_core.hpp.
template<typename CharT = char, typename Traits = std::regex_traits<CharT>>
The std::regex for the std / lazy-std path (built once on demand for a real-backed pattern reached via a constraining flag / nullable replace-iterate / $0/sed replace).
Thread-safe: std::regex guarantees concurrent const operations on one object are safe, but this builds lazy_std_ (a mutable member) on demand. A function-local static build mutex serialises the build (and the read is taken under the same lock), so the guarantee holds for nullable AND non-nullable real-backed patterns. std::once_flag would be lighter but is non-copyable, and basic_regex must stay copyable (std::regex is); a static mutex keeps the value semantics defaulted. The build is per operation, cold relative to matching.
Definition at line 710 of file regex_core.hpp.
template<typename CharT = char, typename Traits = std::regex_traits<CharT>>
Whether replace/iterate run on the real traversal (real-backed AND non-nullable). A nullable pattern delegates replace/iterate to std (the empty-match traversal differs; and iterating a nullable pattern whose per-position match cost is O(n) is O(n²) on any linear engine, so routing it buys correctness but not a linear guarantee — see the nullable note in COMPATIBILITY.md).
Definition at line 696 of file regex_core.hpp.