libstdc++
std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits > Class Template Reference

#include <regex>

Public Types

typedef std::ptrdiff_t difference_type
 
typedef std::forward_iterator_tag iterator_category
 
typedef std::input_iterator_tag iterator_concept
 
typedef const value_typepointer
 
typedef const value_typereference
 
typedef basic_regex< _Ch_type, _Rx_traits > regex_type
 
typedef sub_match< _Bi_iter > value_type
 

Public Member Functions

 regex_token_iterator ()
 
template<std::size_t _Nm>
 regex_token_iterator (_Bi_iter __a, _Bi_iter __b, const regex_type &__re, const int(&__submatches)[_Nm], regex_constants::match_flag_type __m=regex_constants::match_default)
 
 regex_token_iterator (_Bi_iter __a, _Bi_iter __b, const regex_type &__re, const std::vector< int > &__submatches, regex_constants::match_flag_type __m=regex_constants::match_default)
 
 regex_token_iterator (_Bi_iter __a, _Bi_iter __b, const regex_type &__re, initializer_list< int > __submatches, regex_constants::match_flag_type __m=regex_constants::match_default)
 
 regex_token_iterator (_Bi_iter __a, _Bi_iter __b, const regex_type &__re, int __submatch=0, regex_constants::match_flag_type __m=regex_constants::match_default)
 
template<std::size_t _Nm>
 regex_token_iterator (_Bi_iter, _Bi_iter, const regex_type &&, const int(&)[_Nm], regex_constants::match_flag_type=regex_constants::match_default)=delete
 
 regex_token_iterator (_Bi_iter, _Bi_iter, const regex_type &&, const std::vector< int > &, regex_constants::match_flag_type=regex_constants::match_default)=delete
 
 regex_token_iterator (_Bi_iter, _Bi_iter, const regex_type &&, initializer_list< int >, regex_constants::match_flag_type=regex_constants::match_default)=delete
 
 regex_token_iterator (_Bi_iter, _Bi_iter, const regex_type &&, int=0, regex_constants::match_flag_type=regex_constants::match_default)=delete
 
 regex_token_iterator (const regex_token_iterator &__rhs)
 
const value_typeoperator* () const
 
regex_token_iteratoroperator++ ()
 
regex_token_iterator operator++ (int)
 
const value_typeoperator-> () const
 
regex_token_iteratoroperator= (const regex_token_iterator &__rhs)
 
bool operator== (const regex_token_iterator &__rhs) const
 
bool operator== (default_sentinel_t) const noexcept
 

Detailed Description

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
class std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >

Iterates over submatches in a range (or splits a text string).

The purpose of this iterator is to enumerate all, or all specified, matches of a regular expression within a text range. The dereferenced value of an iterator of this class is a std::sub_match object.

Since
C++11

Definition at line 2888 of file regex.h.

Member Typedef Documentation

◆ difference_type

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
typedef std::ptrdiff_t std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::difference_type

Definition at line 2893 of file regex.h.

◆ iterator_category

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
typedef std::forward_iterator_tag std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::iterator_category

Definition at line 2896 of file regex.h.

◆ iterator_concept

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
typedef std::input_iterator_tag std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::iterator_concept

Definition at line 2898 of file regex.h.

◆ pointer

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
typedef const value_type* std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::pointer

Definition at line 2894 of file regex.h.

◆ reference

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
typedef const value_type& std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::reference

Definition at line 2895 of file regex.h.

◆ regex_type

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
typedef basic_regex<_Ch_type, _Rx_traits> std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::regex_type

Definition at line 2891 of file regex.h.

◆ value_type

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
typedef sub_match<_Bi_iter> std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::value_type

Definition at line 2892 of file regex.h.

Constructor & Destructor Documentation

◆ regex_token_iterator() [1/6]

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::regex_token_iterator ( )
inline

Default constructs a regex_token_iterator.

A default-constructed regex_token_iterator is a singular iterator that will compare equal to the one-past-the-end value for any iterator of the same type.

Definition at line 2909 of file regex.h.

Referenced by operator++(), operator=(), and operator==().

◆ regex_token_iterator() [2/6]

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::regex_token_iterator ( _Bi_iter __a,
_Bi_iter __b,
const regex_type & __re,
int __submatch = 0,
regex_constants::match_flag_type __m = regex_constants::match_default )
inline

Constructs a regex_token_iterator...

Parameters
__a[IN] The start of the text to search.
__b[IN] One-past-the-end of the text to search.
__re[IN] The regular expression to search for.
__submatch[IN] Which submatch to return. There are some special values for this parameter:
  • -1 each enumerated subexpression does NOT match the regular expression (aka field splitting)
  • 0 the entire string matching the subexpression is returned for each match within the text.
  • >0 enumerates only the indicated subexpression from a match within the text.
__m[IN] Policy flags for match rules.

Definition at line 2931 of file regex.h.

◆ regex_token_iterator() [3/6]

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::regex_token_iterator ( _Bi_iter __a,
_Bi_iter __b,
const regex_type & __re,
const std::vector< int > & __submatches,
regex_constants::match_flag_type __m = regex_constants::match_default )
inline

Constructs a regex_token_iterator...

Parameters
__a[IN] The start of the text to search.
__b[IN] One-past-the-end of the text to search.
__re[IN] The regular expression to search for.
__submatches[IN] A list of subexpressions to return for each regular expression match within the text.
__m[IN] Policy flags for match rules.

Definition at line 2947 of file regex.h.

◆ regex_token_iterator() [4/6]

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::regex_token_iterator ( _Bi_iter __a,
_Bi_iter __b,
const regex_type & __re,
initializer_list< int > __submatches,
regex_constants::match_flag_type __m = regex_constants::match_default )
inline

Constructs a regex_token_iterator...

Parameters
__a[IN] The start of the text to search.
__b[IN] One-past-the-end of the text to search.
__re[IN] The regular expression to search for.
__submatches[IN] A list of subexpressions to return for each regular expression match within the text.
__m[IN] Policy flags for match rules.

Definition at line 2964 of file regex.h.

◆ regex_token_iterator() [5/6]

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
template<std::size_t _Nm>
std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::regex_token_iterator ( _Bi_iter __a,
_Bi_iter __b,
const regex_type & __re,
const int(&) __submatches[_Nm],
regex_constants::match_flag_type __m = regex_constants::match_default )
inline

Constructs a regex_token_iterator...

Parameters
__a[IN] The start of the text to search.
__b[IN] One-past-the-end of the text to search.
__re[IN] The regular expression to search for.
__submatches[IN] A list of subexpressions to return for each regular expression match within the text.
__m[IN] Policy flags for match rules.

Definition at line 2982 of file regex.h.

◆ regex_token_iterator() [6/6]

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::regex_token_iterator ( const regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits > & __rhs)
inline

Copy constructs a regex_token_iterator.

Parameters
__rhs[IN] A regex_token_iterator to copy.

Definition at line 3014 of file regex.h.

Member Function Documentation

◆ operator*()

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
const value_type & std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::operator* ( ) const
inline

Dereferences a regex_token_iterator.

Definition at line 3052 of file regex.h.

◆ operator++() [1/2]

template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits > & std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::operator++ ( )

Increments a regex_token_iterator.

Definition at line 609 of file regex.tcc.

References regex_token_iterator().

◆ operator++() [2/2]

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
regex_token_iterator std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::operator++ ( int )
inline

Postincrements a regex_token_iterator.

Definition at line 3072 of file regex.h.

◆ operator->()

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
const value_type * std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::operator-> ( ) const
inline

Selects a regex_token_iterator member.

Definition at line 3059 of file regex.h.

◆ operator=()

template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits > & std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::operator= ( const regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits > & __rhs)

Assigns a regex_token_iterator to another.

Parameters
__rhs[IN] A regex_token_iterator to copy.

Definition at line 573 of file regex.tcc.

References regex_token_iterator().

◆ operator==() [1/2]

template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
bool std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::operator== ( const regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits > & __rhs) const

Compares a regex_token_iterator to another for equality.

Definition at line 589 of file regex.tcc.

References regex_token_iterator().

◆ operator==() [2/2]

template<typename _Bi_iter, typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type, typename _Rx_traits = regex_traits<_Ch_type>>
bool std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >::operator== ( default_sentinel_t ) const
inlinenoexcept

Definition at line 3035 of file regex.h.


The documentation for this class was generated from the following files: