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_typetypedef std::forward_iterator_tag iterator_categorytypedef std::input_iterator_tag iterator_concepttypedef const value_type * pointertypedef const value_type & referencetypedef basic_regex< _Ch_type, _Rx_traits > regex_typetypedef sub_match< _Bi_iter > value_type
π¦ Public Member Functions π¦
regex_token_iterator ()β Default constructs aregex_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-sizedintarray 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 singleint __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 aregex_token_iterator.const value_type & operator* () constβ Dereferences aregex_token_iterator.regex_token_iterator & operator++ ()β Increments aregex_token_iterator.regex_token_iterator operator++ (int)β Postincrements aregex_token_iterator.const value_type * operator-> () constβ Selects aregex_token_iteratormember.regex_token_iterator & operator= (const regex_token_iterator &__rhs)β Assigns aregex_token_iteratorto another.bool operator== (const regex_token_iterator &__rhs) constβ Compares aregex_token_iteratorto another for equality.bool operator== (default_sentinel_t) const noexceptβ compares againstdefault_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] β Aregex_token_iteratorto 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] β Aregex_token_iteratorto 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
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms