Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | regex
(fmt)
(formatting)
Line 50: Line 50:
  
 
{{dcl list h2 | Size}}
 
{{dcl list h2 | Size}}
{{dcl list mem fun | cpp/regex/match_results/empty | Indicates if {{cpp | 1=size()}} {{==}} 0. }}
+
{{dcl list mem fun | cpp/regex/match_results/empty | }}
{{dcl list mem fun | cpp/regex/match_results/size | Returns the number of matches in a fully-established result state.}}
+
{{dcl list mem fun | cpp/regex/match_results/size | the number of matches in a fully-established result state}}
{{dcl list mem fun | cpp/regex/match_results/max_size | Returns the maximum possible number of sub-matches.}}
+
{{dcl list mem fun | cpp/regex/match_results/max_size | the maximum possible number of sub-matches}}
  
 
{{dcl list h2 | Element access}}
 
{{dcl list h2 | Element access}}
Line 59: Line 59:
 
{{dcl list mem fun | cpp/regex/match_results/str | returns the sequence of characters for the particular sub-match}}
 
{{dcl list mem fun | cpp/regex/match_results/str | returns the sequence of characters for the particular sub-match}}
 
{{dcl list mem fun | cpp/regex/match_results/operator_at | title=operator[] | returns an {{rlpt|sub_match}} defining particular sub-match}}
 
{{dcl list mem fun | cpp/regex/match_results/operator_at | title=operator[] | returns an {{rlpt|sub_match}} defining particular sub-match}}
{{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 mem fun | cpp/regex/match_results/prefix | sub-sequence between the beginning of the target sequence and the beginning of the full match.}}
{{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 mem fun | cpp/regex/match_results/suffix | sub-sequence between the end of the full match and the end of the target sequence}}
  
 
{{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 mem fun | cpp/regex/match_results/format | match results for output}}
  
 
{{dcl list h2 | Modifiers}}
 
{{dcl list h2 | Modifiers}}
{{dcl list mem fun | cpp/regex/match_results/swap | Swaps the contents of the match_results.}}
+
{{dcl list mem fun | cpp/regex/match_results/swap | the contents}}
 
{{dcl list end}}
 
{{dcl list end}}

Revision as of 13:10, 29 October 2011

Template:cpp/regex/match results/sidebar

Defined in header <regex>
template<

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

> class match_results;
Template:mark c++11 feature

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