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;
Preconditions: ready() == true.
Returns: (*this)[sub].length().
difference_type position(size_type sub = 0) const;
Preconditions: ready() == true.
Returns: The distance from the start of the target sequence to (*this)[sub].first.
string_type str(size_type sub = 0) const;
Preconditions: ready() == true.
Returns: string_type((*this)[sub]).
const_reference operator[](size_type n) const;
Preconditions: 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;
Preconditions: 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;
Preconditions: 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.