|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
A matched sub-expression: a [first, second) range into the searched sequence.
More...
#include <regex_match.hpp>
Public Types | |
| using | iterator = BidirIt |
| The underlying iterator. | |
| using | value_type = typename std::iterator_traits< BidirIt >::value_type |
| The character type. | |
| using | difference_type = typename std::iterator_traits< BidirIt >::difference_type |
| Distance type. | |
| using | string_type = std::basic_string< value_type > |
| The owning string type. | |
Public Member Functions | |
| difference_type | length () const |
| Length of the sub-match (0 if it did not participate). | |
| string_type | str () const |
| The matched text as an owned string (empty if it did not participate). | |
| operator string_type () const | |
| Implicit conversion to the owned string (std::sub_match parity). | |
| std::basic_string_view< value_type > | view () const |
A non-owning view of the matched text. REAL's addition; std::sub_match has no such member. | |
| int | compare (const string_type &other) const |
Three-way length/lexicographic comparison against a string (std::sub_match::compare). | |
| int | compare (const sub_match &other) const |
| Three-way comparison against another sub-match, by matched text. | |
Public Attributes | |
| BidirIt | first {} |
| Start of the sub-match. | |
| BidirIt | second {} |
| One past the end of the sub-match. | |
| bool | matched {false} |
| Whether this sub-expression participated. | |
A matched sub-expression: a [first, second) range into the searched sequence.
Contiguous iterators only — sub_match is built from byte offsets, which requires the underlying storage to be contiguous (a std::deque::iterator is random-access but not contiguous, so it is rejected).
| BidirIt | A contiguous iterator into the searched sequence. |
|
inline |
Three-way length/lexicographic comparison against a string (std::sub_match::compare).
| [in] | other | The string to compare against. |
str() orders before, equal to, or after other.
|
inline |
Three-way comparison against another sub-match, by matched text.
| [in] | other | The sub-match to compare against. |
str() orders before, equal to, or after other.str().
|
inline |
Length of the sub-match (0 if it did not participate).
second - first, or 0 when matched is false.
|
inline |
The matched text as an owned string (empty if it did not participate).
[first, second), or an empty string when matched is false.
|
inline |
A non-owning view of the matched text. REAL's addition; std::sub_match has no such member.
[first, second), or an empty view when matched is false.