A matched sub-expression: a [first, second) range into the searched sequence. Any bidirectional iterator, as std::sub_match; only view needs contiguous storage.
More...
#include <regex_match.hpp>
|
|
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.
|
| |
|
| 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; a REAL extension, not in std::sub_match.
|
| |
| int | compare (const string_type &other) const |
| | Three-way length/lexicographic comparison against a string (std::sub_match::compare).
|
| |
| int | compare (const value_type *other) const |
| | Three-way comparison against a C string (std::sub_match::compare).
|
| |
| int | compare (const sub_match &other) const |
| | Three-way comparison against another sub-match, by matched text.
|
| |
|
|
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.
|
| |
template<typename BidirIt>
class real::compat::sub_match< BidirIt >
A matched sub-expression: a [first, second) range into the searched sequence. Any bidirectional iterator, as std::sub_match; only view needs contiguous storage.
- Template Parameters
-
| BidirIt | A bidirectional iterator into the searched sequence. |
◆ compare() [1/3]
template<typename BidirIt >
Three-way length/lexicographic comparison against a string (std::sub_match::compare).
- Parameters
-
| [in] | other | The string to compare against. |
- Returns
- Negative, zero or positive as
str() orders before, equal to, or after other.
◆ compare() [2/3]
template<typename BidirIt >
Three-way comparison against another sub-match, by matched text.
- Parameters
-
| [in] | other | The sub-match to compare against. |
- Returns
- Negative, zero or positive as
str() orders before, equal to, or after other.str().
◆ compare() [3/3]
template<typename BidirIt >
Three-way comparison against a C string (std::sub_match::compare).
- Parameters
-
| [in] | other | The NUL-terminated string to compare against. |
- Returns
- Negative, zero or positive as
str() orders before, equal to, or after other.
◆ length()
template<typename BidirIt >
Length of the sub-match (0 if it did not participate).
- Returns
second - first, or 0 when matched is false.
◆ str()
template<typename BidirIt >
The matched text as an owned string (empty if it did not participate).
- Returns
- A copy of
[first, second), or an empty string when matched is false.
◆ view()
template<typename BidirIt >
A non-owning view of the matched text; a REAL extension, not in std::sub_match.
Contiguous iterators only: an owning string returned under this name for a std::list would dangle once bound to a string_view. str serves every iterator.
- Returns
- A view over
[first, second), or an empty view when matched is false.
The documentation for this class was generated from the following file: