Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/regex/match results"

From cppreference.com
< cpp‎ | regex
m (er, that was tfun. Also, non-member swap)
m (Text replace - "{{tdcl list begin" to "{{dcl list begin")
Line 16: Line 16:
 
Several specializations for common character sequence types are provided:  
 
Several specializations for common character sequence types are provided:  
  
{{tdcl list begin}}
+
{{list begin}}
 
{{tdcl list header | regex}}
 
{{tdcl list header | regex}}
 
{{tdcl list hitem | Type | Definition}}
 
{{tdcl list hitem | Type | Definition}}
Line 26: Line 26:
  
 
===Member types===
 
===Member types===
{{tdcl list begin}}
+
{{list begin}}
 
{{tdcl list hitem | Member type | Definition}}
 
{{tdcl list hitem | Member type | Definition}}
 
{{tdcl list item | {{tt|allocator_type}} | {{c|Allocator}}}}
 
{{tdcl list item | {{tt|allocator_type}} | {{c|Allocator}}}}

Revision as of 02:22, 12 June 2012

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 std::match_results 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 std::regex_search() or std::regex_match() 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 headerTemplate:tdcl list hitemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list end

Contents

Member types

Template:tdcl list hitemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate:tdcl list itemTemplate: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 operator=Template: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 lengthTemplate:cpp/regex/match results/dcl list positionTemplate:cpp/regex/match results/dcl list strTemplate:cpp/regex/match results/dcl list operator atTemplate:cpp/regex/match results/dcl list prefixTemplate:cpp/regex/match results/dcl list suffixTemplate:cpp/regex/match results/dcl list beginTemplate:cpp/regex/match results/dcl list endTemplate:cpp/regex/match results/dcl list formatTemplate:cpp/regex/match results/dcl list swap
State

(public member function)
Size
Element access
Iterators
Format
Modifiers

Non-member functions

lexicographically compares the values in the two match result
(function template)
specializes the Template:cpp/ltf algorithm
(function template)