Namespaces
Variants
Views
Actions

std::match_results

From cppreference.com
< cpp‎ | regex
Revision as of 15:54, 24 December 2011 by P12bot (Talk | contribs)

Template:cpp/regex/match results/sidebar

Defined in header <regex>
template<

    class BidirectionalIterator,
    class Allocator = std::allocator<std::sub_match<BidirectionalIterator>>

> class match_results;
(since C++11)

The class template Template:cpp holds a collection of character sequences that represent the result of a regular expression match.

This is a specialized allocator-aware container. It can only be default created or modified by passing to the Template:cpp or Template:cpp algorithms.

The first sub_match (index 0) contained in a match_result always represents the full match within a target sequence made by a regex, and subsequent sub_matches represent sub-expression matches corresponding in sequence to the left parenthesis delimiting the sub-expression in the regex.

Several specializations for common character sequence types are provided:

Template:tdcl list begin Template:tdcl list header Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list end

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list end

Member functions

Template:cpp/regex/match results/dcl list constructorTemplate:cpp/regex/match results/dcl list destructorTemplate:cpp/regex/match results/dcl list get allocatorTemplate:cpp/regex/match results/dcl list emptyTemplate:cpp/regex/match results/dcl list sizeTemplate:cpp/regex/match results/dcl list max sizeTemplate:cpp/regex/match results/dcl list beginTemplate:cpp/regex/match results/dcl list end
State

(public member function)
Size
Element access
returns the length of the particular sub-match
(public member function)
returns the position of the first character of the particular sub-match
(public member function)
returns the sequence of characters for the particular sub-match
(public member function)
returns an sub_match defining particular sub-match
(public member function)
returns sub-sequence between the beginning of the target sequence and the beginning of the full match.
(public member function)
returns sub-sequence between the end of the full match and the end of the target sequence
(public member function)
Iterators
Format
formats match results for output
(public member function)
Modifiers
swaps the contents
(public member function)