Namespaces
Variants
Views
Actions

std::regex_token_iterator::regex_token_iterator

From cppreference.com
< cpp‎ | regex‎ | regex token iterator
Revision as of 13:29, 3 November 2013 by Jaredgrubb (Talk | contribs)

regex_token_iterator();
(1) (since C++11)
regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b,

                      const regex_type& re,
                      int submatch = 0,
                      std::regex_constants::match_flag_type m =

                          std::regex_constants::match_default );
(2) (since C++11)
regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b,

                      const regex_type& re,
                      const std::vector<int>& submatches,
                      std::regex_constants::match_flag_type m =

                          std::regex_constants::match_default );
(3) (since C++11)
regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b,

                      const regex_type& re,
                      std::initializer_list<int> submatches,
                      std::regex_constants::match_flag_type m =

                          std::regex_constants::match_default );
(4) (since C++11)
template <std::size_t N>

regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b,
                      const regex_type& re,
                      const int (&submatches)[N],
                      std::regex_constants::match_flag_type m =

                          std::regex_constants::match_default );
(5) (since C++11)
regex_token_iterator( const regex_token_iterator& other );
(6) (since C++11)

Constructs a new regex_token_iterator:

1) Default constructor. Constructs an end-of-sequence iterator.
2-5) Perform a regex_search using the given regex and stop on the given submatch(es).
6) Copy constructor.

Parameters

a - BidirectionalIterator to the beginning of the target character sequence
b - BidirectionalIterator to the end of the targe character sequence
re - regular expression used to search the target character sequence
submatch - the index of the submatch that should be returned. "0" represents the entire match, and "-1" represents the parts that are not matched (eg, the stuff between matches).
submatches - a sequence of submatch indices that should be returned; note that the iterator must be advanced 'N' times for each regex_search match that occurs.
m - flags that govern the behavior of re

Example