Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | regex
m (Text replace - "{{cpp|" to "{{c|")
(move to templates)
Line 55: Line 55:
  
 
{{dcl list h2 | Element access}}
 
{{dcl list h2 | Element access}}
{{dcl list mem fun | cpp/regex/match_results/length | returns the length of the particular sub-match}}
+
{{dcl list | cpp/regex/match_results/length}}
{{dcl list mem fun | cpp/regex/match_results/position | returns the position of the first character of the particular sub-match}}
+
{{dcl list | cpp/regex/match_results/position}}
{{dcl list mem fun | cpp/regex/match_results/str | returns the sequence of characters for the particular sub-match}}
+
{{dcl list | cpp/regex/match_results/str}}
{{dcl list mem fun | cpp/regex/match_results/operator_at | title=operator[] | returns an {{rlpt|sub_match}} defining particular sub-match}}
+
{{dcl list | cpp/regex/match_results/operator_at}}
{{dcl list mem fun | cpp/regex/match_results/prefix | returns sub-sequence between the beginning of the target sequence and the beginning of the full match.}}
+
{{dcl list | cpp/regex/match_results/prefix}}
{{dcl list mem fun | cpp/regex/match_results/suffix | returns sub-sequence between the end of the full match and the end of the target sequence}}
+
{{dcl list | cpp/regex/match_results/suffix}}
  
 
{{dcl list h2 | Iterators}}
 
{{dcl list h2 | Iterators}}
Line 67: Line 67:
  
 
{{dcl list h2 | Format}}
 
{{dcl list h2 | Format}}
{{dcl list mem fun | cpp/regex/match_results/format | formats match results for output}}
+
{{dcl list | cpp/regex/match_results/format}}
  
 
{{dcl list h2 | Modifiers}}
 
{{dcl list h2 | Modifiers}}
{{dcl list mem fun | cpp/regex/match_results/swap | swaps the contents}}
+
{{dcl list | cpp/regex/match_results/swap}}
 +
 
 
{{dcl list end}}
 
{{dcl list end}}

Revision as of 05:19, 21 April 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 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 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