STD::REGEX_TOKEN_ITERATOR(3cxx)

🌸 NAME 🌸

okay so this is the std::regex_tok...e, _Rx_traits >(3cxx) manual page, bestie, and the main character is std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >. Section 3cxx, C++ standard library, no cap. πŸ’–

✨ SYNOPSIS ✨

#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_type * pointer
  • typedef const value_type & reference
  • typedef basic_regex< _Ch_type, _Rx_traits > regex_type
  • typedef sub_match< _Bi_iter > value_type

πŸ¦‹ Public Member Functions πŸ¦‹

  • regex_token_iterator () β€” Default constructs a 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) β€” the _Nm-sized int array overload; parameter tea is below.
  • 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) β€” vector-of-submatch-indices overload; details below.
  • 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) β€” initializer-list overload; details below.
  • 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) β€” the one with a single int __submatch=0; details below.
  • 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 β€” deleted rvalue-regex overload (=delete), so it's not callable.
  • regex_token_iterator (_Bi_iter, _Bi_iter, const regex_type &&, const std::vector< int > &, regex_constants::match_flag_type=regex_constants::match_default)=delete β€” deleted rvalue-regex overload.
  • regex_token_iterator (_Bi_iter, _Bi_iter, const regex_type &&, initializer_list< int >, regex_constants::match_flag_type=regex_constants::match_default)=delete β€” deleted rvalue-regex overload.
  • regex_token_iterator (_Bi_iter, _Bi_iter, const regex_type &&, int=0, regex_constants::match_flag_type=regex_constants::match_default)=delete β€” deleted rvalue-regex overload.
  • regex_token_iterator (const regex_token_iterator &__rhs) β€” Copy constructs a regex_token_iterator.
  • const value_type & operator* () const β€” Dereferences a regex_token_iterator.
  • regex_token_iterator & operator++ () β€” Increments a regex_token_iterator.
  • regex_token_iterator operator++ (int) β€” Postincrements a regex_token_iterator.
  • const value_type * operator-> () const β€” Selects a regex_token_iterator member.
  • regex_token_iterator & operator= (const regex_token_iterator &__rhs) β€” Assigns a regex_token_iterator to another.
  • bool operator== (const regex_token_iterator &__rhs) const β€” Compares a regex_token_iterator to another for equality.
  • bool operator== (default_sentinel_t) const noexcept β€” compares against default_sentinel_t; the docs give no extra description.

πŸ’– 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 docs literally start that description with >"Iterates over submatches in a range (or splits a text string). β€” the stray quote mark is canon, I'm not fixing it. 😭

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

🧚 Constructor & Destructor Documentation 🧚

regex_token_iterator ()

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. That's the vibe check: singular, but it matches the one-past-the-end energy. πŸ’…

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<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... β€” yes, the docs really trail off with the ellipsis, and I respect it.

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.

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)

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... β€” ellipsis again, iconic.

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.

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)

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... β€” the ellipsis stays, periodt.

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.

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)

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... β€” the _Nm array girlies, we see you.

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.

regex_token_iterator (const regex_token_iterator & __rhs)

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.
heads up, bestie: the synopsis also lists four =deleted rvalue-regex constructors. They're up in Public Member Functions, and the detailed docs don't give them their own parameter descriptions.

πŸ’… Member Function Documentation πŸ’…

operator* () const

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. Obsessed with a one-liner that does exactly what it says. ✨

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++
    ()

Increments a regex_token_iterator.

operator++ (int)

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.

operator-> () const

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.

operator= (const regex_token_iterator & __rhs)

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.

operator== (const regex_token_iterator & __rhs) const

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.

also in the synopsis: bool operator== (default_sentinel_t) const noexcept. The docs don't give it a separate detailed description, but it's there, bestie.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. Slay, automation. πŸ’œ


footer vibe check: source/version is libstdc++ (the literal footer line is libstdstd::regex_tok...e, _Rx_traits >(3cxx)), and the date isn't printed on this page β€” so consider this entry undated, bestie. bye! πŸ¦‹πŸ’–

πŸ“¦ where this page comes from