32 Regular expressions library [re]

32.8 Class template sub_match [re.submatch]

32.8.2 Members [re.submatch.members]

constexpr sub_match();
Effects: Value-initializes the pair base class subobject and the member matched.
difference_type length() const;
Returns: matched ? distance(first, second) : 0.
operator string_type() const;
Returns: matched ? string_type(first, second) : string_type().
string_type str() const;
Returns: matched ? string_type(first, second) : string_type().
int compare(const sub_match& s) const;
Returns: str().compare(s.str()).
int compare(const string_type& s) const;
Returns: str().compare(s).
int compare(const value_type* s) const;
Returns: str().compare(s).
void swap(sub_match& s) noexcept(see below);
Preconditions: BidirectionalIterator meets the Cpp17Swappable requirements ([swappable.requirements]).
Effects: Equivalent to: this->pair<BidirectionalIterator, BidirectionalIterator>::swap(s); std::swap(matched, s.matched);
Remarks: The exception specification is equivalent to is_nothrow_swappable_v<BidirectionalIterator>.