A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/regex_iterator below:

class template

<regex>

std::regex_iterator
template <class BidirectionalIterator,          class charT=typename iterator_traits<BidirectionalIterator>::value_type,          class traits=regex_traits<charT> > class regex_iterator;

Regex iterator

Iterator type to iterate over different matches of a same regex pattern in a sequence.

When constructed, and every time operator++ is applied to it, the iterator performs a regex_search to find successive matches on a sequence. Dereferencing a valid regex_iterator yields a match_results object.

A special value of regex_iterator is used to indicate an end-of-sequence. This iterator should not be dereferenced. Its value is the same for all end-of-sequence regex_iterator objects of the same type, no matter the sequence being iterated by each.

Internally, the object keeps a match_results object with the information about the most recent match (if any), which is updated every time the iterator is incremented with operator++. A reference to this object is returned when the iterator is dereferenced using operator*.

Apart from that match_results object, the iterator keeps internally the following information set either on construction or due to an assignment operation:




Template parameters
BidirectionalIterator
A bidirectional iterator type that iterates on the target sequence of characters.
charT
The character type.
traits
A regex traits type (see regex_traits for further info).

Member types The following aliases are member types of match_results. They are widely used as parameter and return types by member functions:

member type definition notes regex_type basic_regex<charT,traits> Type of the basic_regex object used as pattern. value_type match_results<BidirectionalIterator> Type of the elements iterated (match_results). pointer const value_type* reference const value_type& difference_type std::ptrdiff_t A signed integral type (see ptrdiff_t). iterator_category std::forward_iterator_tag Forward iterator


Member functions
(constructor)
Construct regex_iterator (public member function)

Operators
operator=
Copy assignment (public member function)
operator==
Compare regex_iterator (public member function)
operator!=
Compare regex_iterator for inequality (public member function)
operator*
Dereference regex_iterator (public member function)
operator->
Dereference regex_iterator (public member function)
operator++
Increment regex_iterator (public member function)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4