cpp/regex/regex iterator

is a read-only iterator that accesses the individual matches of a regular expression within the underlying character sequence. It meets the requirements of a, except that for dereferenceable values and  with ,  and  will not be bound to the same object.

On construction, and on every increment, it calls std and remembers the result (that is, saves a copy of the value). The first object may be read when the iterator is constructed or when the first dereferencing is done. Otherwise, dereferencing only returns a copy of the most recently obtained regex match.

The default-constructed is the end-of-sequence iterator. When a valid is incremented after reaching the last match (std returns ), it becomes equal to the end-of-sequence iterator. Dereferencing or incrementing it further invokes undefined behavior.

A typical implementation of holds the begin and the end iterators for the underlying sequence (two instances of ), a pointer to the regular expression, the match flags (std), and the current match.

Specializations
Several specializations for common character sequence types are defined: