STD::REGEX_ITERATOR(3)
β¨ NAME β¨
std::regex_iterator< _Bi_iter, _Ch_type, _Rx_traits > β bestie, this is the iterator adaptor that keeps hitting regex_search over and over on a range until there's literally nothing left to match π
(This page lives in the std::regex...Rx_traits >(3) corner of the libstdc++ manual, iykyk.)
πΈ 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 match_results< _Bi_iter > value_type
π Public Member Functions
regex_iterator ()=defaultβ hands you a singular iterator, which is exactly what you want for flagging one-past-the-end of a range β¨regex_iterator (_Bi_iter __a, _Bi_iter __b, const regex_type &__re, regex_constants::match_flag_type __m=regex_constants::match_default)regex_iterator (_Bi_iter, _Bi_iter, const regex_type &&, regex_constants::match_flag_type=regex_constants::match_default)=deleteregex_iterator (const regex_iterator &)=defaultβ copy constructs aregex_iterator, no cap π«Άconst value_type & operator* () const noexceptβ dereferences aregex_iteratorregex_iterator & operator++ ()β increments aregex_iteratorregex_iterator operator++ (int)β postincrements aregex_iteratorconst value_type * operator-> () const noexceptβ selects aregex_iteratormemberregex_iterator & operator= (const regex_iterator &)=defaultβ copy assigns oneregex_iteratorto anotherbool operator== (const regex_iterator &) const noexceptβ tests whether two regex iterators are equivalentbool 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_iterator< _Bi_iter, _Ch_type, _Rx_traits >"An iterator
adaptor that will provide repeated calls of regex_search over a range
until no more matches remain.
It's giving iterator adaptor, and its whole personality is calling regex_search on your range again and again and again until there are genuinely zero matches left. Obsessed. π
Since β C++11 β
π§ Constructor & Destructor Documentation π§
template<typename _Bi_iter, typename _Ch_type = typename
iterator_traits<_Bi_iter>::value_type, typename _Rx_traits =
regex_traits<_Ch_type>> std::regex_iterator< _Bi_iter, _Ch_type,
_Rx_traits >::regex_iterator () [default]
Provides a singular iterator, useful for indicating one-past-the-end of a range. π«
Referenced bystd::regex_iterator< const char * >::regex_iterator(), andoperator==().
template<typename _Bi_iter, typename _Ch_type = typename
iterator_traits<_Bi_iter>::value_type, typename _Rx_traits =
regex_traits<_Ch_type>> std::regex_iterator< _Bi_iter, _Ch_type,
_Rx_traits >::regex_iterator (_Bi_iter __a, _Bi_iter __b, const
regex_type & __re, regex_constants::match_flag_type __m =
regex_constants::match_default) [inline]
Constructs a regex_iterator... β¨
Parameters
__a[IN]β where your text range starts, bestie__b[IN]β one-past-the-end of the text range you're searching__re[IN]β the regular expression to match__m[IN]β policy flags for match rules
template<typename _Bi_iter, typename _Ch_type = typename
iterator_traits<_Bi_iter>::value_type, typename _Rx_traits =
regex_traits<_Ch_type>> std::regex_iterator< _Bi_iter, _Ch_type,
_Rx_traits >::regex_iterator (const regex_iterator< _Bi_iter, _Ch_type,
_Rx_traits > & ) [default]
Copy constructs a regex_iterator. Simple as that, slay. π
π Member Function Documentation π
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_iterator<
_Bi_iter, _Ch_type, _Rx_traits >::operator* () const [inline],
[noexcept]
Dereferences a regex_iterator. π
template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
regex_iterator< _Bi_iter, _Ch_type, _Rx_traits > & std::regex_iterator<
_Bi_iter, _Ch_type, _Rx_traits >::operator++ ()
Increments a regex_iterator. The way this one just keeps going until it can't β main character energy fr fr. π₯
Referencesstd::regex_constants::match_continuous,std::regex_constants::match_not_null,std::regex_constants::match_prev_avail, andstd::regex_search().
template<typename _Bi_iter, typename _Ch_type = typename
iterator_traits<_Bi_iter>::value_type, typename _Rx_traits =
regex_traits<_Ch_type>> regex_iterator std::regex_iterator< _Bi_iter,
_Ch_type, _Rx_traits >::operator++ (int ) [inline]
Postincrements a regex_iterator. π
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_iterator<
_Bi_iter, _Ch_type, _Rx_traits >::operator-> () const [inline],
[noexcept]
Selects a regex_iterator member. π
template<typename _Bi_iter, typename _Ch_type = typename
iterator_traits<_Bi_iter>::value_type, typename _Rx_traits =
regex_traits<_Ch_type>> regex_iterator & std::regex_iterator< _Bi_iter,
_Ch_type, _Rx_traits >::operator= (const regex_iterator< _Bi_iter,
_Ch_type, _Rx_traits > & ) [default]
Copy assigns one regex_iterator to another. π
template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits> bool
std::regex_iterator< _Bi_iter, _Ch_type, _Rx_traits >::operator== (const
regex_iterator< _Bi_iter, _Ch_type, _Rx_traits > & __rhs) const
[noexcept]
Tests the equivalence of two regex iterators. π
References regex_iterator().
β Author β
Generated automatically by Doxygen for libstdc++ from the source code.
okay that's the whole page bestie, you ate π this one's libstdc++, std::regex...Rx_traits >(3), and yeah it was auto-generated by Doxygen β no cap, go read it and slay πβ¨π¦
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms