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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant