Files
2025-10-25 03:02:53 +03:00

2.8 KiB

[re.submatch.members]

28 Text processing library [text]

28.6 Regular expressions library [re]

28.6.8 Class template sub_match [re.submatch]

28.6.8.2 Members [re.submatch.members]

🔗

constexpr sub_match();

1

#

Effects: Value-initializes the pair base class subobject and the membermatched.

🔗

difference_type length() const;

2

#

Returns: matched ? distance(first, second) : 0.

🔗

operator string_type() const;

3

#

Returns: matched ? string_type(first, second) : string_type().

🔗

string_type str() const;

4

#

Returns: matched ? string_type(first, second) : string_type().

🔗

int compare(const sub_match& s) const;

5

#

Returns: str().compare(s.str()).

🔗

int compare(const string_type& s) const;

6

#

Returns: str().compare(s).

🔗

int compare(const value_type* s) const;

7

#

Returns: str().compare(s).

🔗

void swap(sub_match& s) noexcept(see below);

8

#

Preconditions: BidirectionalIterator meets the Cpp17Swappable requirements ([swappable.requirements]).

9

#

Effects: Equivalent to:this->pair<BidirectionalIterator, BidirectionalIterator>::swap(s); std::swap(matched, s.matched);

10

#

Remarks: The exception specification is equivalent tois_nothrow_swappable_v.