|
| constexpr | basic_match_result ()=default |
| | Constructs an empty (non-matched) result.
|
| |
| constexpr | basic_match_result (std::string_view text, SlotStorage slots, bool matched, std::string_view pattern, std::span< const detail::named_group > names) |
| | Constructs a result from raw slots (used internally by the engine).
|
| |
| template<bool Cascade, typename Vm > |
| constexpr bool | engine_refill (Vm &vm, std::string_view text, std::size_t pos, detail::run_mode mode, std::size_t forbid, std::string_view pattern, std::span< const detail::named_group > names) |
| | Engine-internal: re-run the search into this result's OWN slot buffer, reusing its capacity. Not part of the public API.
|
| |
| constexpr void | bind_context (std::string_view text, std::string_view pattern, std::span< const detail::named_group > names) |
| | Binds the invariant context (subject, pattern, named groups) once. For an iterator that refills the same result many times, these never change within a walk — set them here, not per match.
|
| |
| template<bool Cascade, typename Vm > |
| constexpr bool | engine_refill_hot (Vm &vm, std::string_view text, std::size_t pos, detail::run_mode mode, std::size_t forbid, match_semantics sem=match_semantics::first) |
| | Per-match refill for an iterator whose context is already bound via bind_context runs the VM and records only the outcome (the invariant fields are already set), the find_iter hot path.
|
| |
| constexpr bool | matched () const |
| | Returns true if the attempt matched.
|
| |
| constexpr | operator bool () const |
| | Returns true if the attempt matched (explicit bool conversion).
|
| |
| constexpr std::size_t | size () const |
| | Returns the number of groups, including group 0 (the whole match).
|
| |
| constexpr std::size_t | start (std::size_t group=0) const |
| | Start byte offset of a group.
|
| |
| constexpr std::size_t | end (std::size_t group=0) const |
| | End byte offset (exclusive) of a group.
|
| |
| constexpr std::string_view | operator[] (std::size_t group) const |
| | View of a group's matched text.
|
| |
| constexpr std::size_t | group_index (std::string_view name) const |
| | Resolves a group name to its number.
|
| |
| constexpr std::size_t | start (std::string_view name) const |
| | Returns its start offset, or npos if unknown.
|
| |
| constexpr std::size_t | end (std::string_view name) const |
| | Returns its end offset, or npos if unknown.
|
| |
| constexpr std::string_view | operator[] (std::string_view name) const |
| | Returns its matched text, empty if unknown/unset.
|
| |
template<typename SlotStorage>
class real::basic_match_result< SlotStorage >
The result of a match attempt: success, spans and captures.
Group views point into the searched text, which must outlive the result — the rvalue std::string overloads on the regex are deleted to catch the common dangling mistake at compile time. Named-group lookups reference the regex's name table, so the regex must outlive the result too.
- Template Parameters
-
| SlotStorage | The capture-slot container (vector- or static-backed), supplied by the storage policy. |
Definition at line 39 of file real.hpp.
template<typename SlotStorage >
template<bool Cascade, typename Vm >
Engine-internal: re-run the search into this result's OWN slot buffer, reusing its capacity. Not part of the public API.
The match iterator holds one result and refreshes it in place each step. vm.run fills the slots via assign, which reuses the existing capacity, so a match-dense iteration allocates the slot vector once instead of once per match — the measured per-match cost (a fresh allocation is ~5x a reused one). A user-held copy of a previous match stays independent: copying a result deep-copies its slots, so refilling this one never disturbs it.
- Template Parameters
-
| Cascade | Select the OPT-C memchr-cascade class-run variant (chosen once per walk). |
| Vm | The Pike VM type (kept a template to avoid a header cycle). |
- Parameters
-
| [in] | vm | The VM to run. |
| [in] | text | The searched text (borrowed). |
| [in] | pos | Start offset for the search. |
| [in] | mode | The run mode. |
| [in] | forbid | The empty-match forbid-until offset. |
| [in] | pattern | The pattern text (for named-group resolution). |
| [in] | names | The regex's named-group table (borrowed). |
- Returns
- Whether a match occurred.
Definition at line 90 of file real.hpp.