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

4.0 KiB

[re.results.acc]

28 Text processing library [text]

28.6 Regular expressions library [re]

28.6.9 Class template match_results [re.results]

28.6.9.5 Element access [re.results.acc]

🔗

difference_type length(size_type sub = 0) const;

1

#

Preconditions: ready() == true.

2

#

Returns: (*this)[sub].length().

🔗

difference_type position(size_type sub = 0) const;

3

#

Preconditions: ready() == true.

4

#

Returns: The distance from the start of the target sequence to (*this)[sub].first.

🔗

string_type str(size_type sub = 0) const;

5

#

Preconditions: ready() == true.

6

#

Returns: string_type((*this)[sub]).

🔗

const_reference operator[](size_type n) const;

7

#

Preconditions: ready() == true.

8

#

Returns: A reference to the sub_match object representing the character sequence that matched marked sub-expression n.

If n == 0 then returns a reference to a sub_match object representing the character sequence that matched the whole regular expression.

Ifn >= size() then returns a sub_match object representing an unmatched sub-expression.

🔗

const_reference prefix() const;

9

#

Preconditions: ready() == true.

10

#

Returns: A reference to the sub_match object representing the character sequence from the start of the string being matched/searched to the start of the match found.

🔗

const_reference suffix() const;

11

#

Preconditions: ready() == true.

12

#

Returns: A reference to the sub_match object representing the character sequence from the end of the match found to the end of the string being matched/searched.

🔗

const_iterator begin() const; const_iterator cbegin() const;

13

#

Returns: A starting iterator that enumerates over all the sub-expressions stored in *this.

🔗

const_iterator end() const; const_iterator cend() const;

14

#

Returns: A terminating iterator that enumerates over all the sub-expressions stored in *this.