28 Regular expressions library [re]

28.10 Class template match_results [re.results]

28.10.4 match_results element access [re.results.acc]

difference_type length(size_type sub = 0) const;

Requires: ready() == true.

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

difference_type position(size_type sub = 0) const;

Requires: ready() == true.

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

string_type str(size_type sub = 0) const;

Requires: ready() == true.

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

const_reference operator[](size_type n) const;

Requires: ready() == true.

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. If n >= size() then returns a sub_match object representing an unmatched sub-expression.

const_reference prefix() const;

Requires: ready() == true.

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;

Requires: ready() == true.

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;

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

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

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