|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
Zero-width assertion evaluation (^ $ \b \B \A \Z \< \>) as free functions over a subject and a position, shared by the Pike VM and the one-pass extractor.
More...
#include <cstddef>#include <cstdint>#include <string_view>#include "real/core/charclass.hpp"#include "real/core/program.hpp"#include "real/unicode/unicode_props.hpp"#include "real/unicode/utf8.hpp"Namespaces | |
| namespace | real |
| REAL's public API: real::regex, real::static_regex, real::flags and the match/iterator types built on them. | |
| namespace | real::detail |
| DFA construction internals: subset construction over a flattened NFA. Not a stable API. | |
Functions | |
| constexpr bool | real::detail::word_before (std::string_view text, std::size_t pos, bool ascii_word) |
Word-ness of the code point ending at pos — the left side of a boundary. False at the text start or on a malformed sequence; ASCII / bytes / re.A (ascii_word) stay byte-level. | |
| constexpr bool | real::detail::word_after (std::string_view text, std::size_t pos, bool ascii_word) |
Word-ness of the code point starting at pos — the right side of a boundary. False at the text end or on a malformed sequence; ASCII / bytes / re.A stay byte-level. | |
| constexpr bool | real::detail::assertion_holds (assert_kind kind, std::string_view text, std::size_t pos, bool ascii_word) |
Evaluates a zero-width assertion at pos in text. | |
Zero-width assertion evaluation (^ $ \b \B \A \Z \< \>) as free functions over a subject and a position, shared by the Pike VM and the one-pass extractor.
The multiline / trailing-newline subtleties are resolved at compile time into the real::detail::assert_kind carried by an assert_position op, so evaluation here is a pure predicate on (text, pos) plus the word-ness mode. Both callers read these functions — the Pike VM per instruction, the one-pass runtime per edge condition — so their notion of a boundary agrees by construction rather than by review.