|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
Iterates the non-overlapping matches of a pattern in a sequence (std::regex_iterator).
More...
#include <regex_iter.hpp>
Public Types | |
| using | value_type = match_results< BidirIt > |
| Yielded match. | |
| using | difference_type = std::ptrdiff_t |
| Iterator traits. | |
| using | pointer = const value_type * |
| Arrow type. | |
| using | reference = const value_type & |
| Dereference type. | |
| using | iterator_category = std::forward_iterator_tag |
| std::regex_iterator parity. | |
| using | regex_type = basic_regex< CharT, Traits > |
| The pattern type. | |
Public Member Functions | |
| regex_iterator ()=default | |
| Constructs the end sentinel. | |
| regex_iterator (BidirIt first, BidirIt last, const regex_type &re, regex_constants::match_flag_type flags=regex_constants::match_default) | |
Constructs a begin iterator over [first, last) and finds the first match. A constraining match flag (see detail::real_honors) routes to the std backend, which carries the flags through the wrapped std::regex_iterator. | |
| regex_iterator (BidirIt first, BidirIt last, const regex_type &&re, regex_constants::match_flag_type flags=regex_constants::match_default)=delete | |
| Constructing from a temporary regex would dangle (std::regex_iterator parity). | |
| reference | operator* () const |
| pointer | operator-> () const |
| regex_iterator & | operator++ () |
| regex_iterator | operator++ (int) |
| bool | operator== (const regex_iterator &other) const |
| bool | operator!= (const regex_iterator &other) const |
Private Member Functions | |
| void | next_real () |
| Advances the real path: next region search from real_pos_. | |
| void | sync_std () |
| Syncs the std path from the wrapped std::regex_iterator. | |
Private Attributes | |
| BidirIt | begin_ {} |
| BidirIt | end_ {} |
| const regex_type * | re_ {nullptr} |
| regex_constants::match_flag_type | flags_ {regex_constants::match_default} |
| bool | real_path_ {false} |
| std::size_t | real_pos_ {} |
| std::optional< std::regex_iterator< BidirIt > > | std_it_ |
| value_type | match_ |
| bool | at_end_ {true} |
Iterates the non-overlapping matches of a pattern in a sequence (std::regex_iterator).
Same per-operation routing as regex_replace — a real-backed, non-nullable pattern drives real's linear traversal (repeated region search — a non-nullable pattern never matches empty, so the position always advances past the match and the ECMAScript and real sequences agree); the std backend and nullable patterns wrap std::regex_iterator (whose empty-match advance is ECMAScript's). The default-constructed iterator is the end sentinel.
| BidirIt | A contiguous iterator into the searched sequence. |
Definition at line 31 of file regex_iter.hpp.
| using real::compat::regex_iterator< BidirIt, CharT, Traits >::difference_type = std::ptrdiff_t |
Iterator traits.
Definition at line 36 of file regex_iter.hpp.
| using real::compat::regex_iterator< BidirIt, CharT, Traits >::iterator_category = std::forward_iterator_tag |
std::regex_iterator parity.
Definition at line 39 of file regex_iter.hpp.
| using real::compat::regex_iterator< BidirIt, CharT, Traits >::pointer = const value_type* |
Arrow type.
Definition at line 37 of file regex_iter.hpp.
| using real::compat::regex_iterator< BidirIt, CharT, Traits >::reference = const value_type& |
Dereference type.
Definition at line 38 of file regex_iter.hpp.
| using real::compat::regex_iterator< BidirIt, CharT, Traits >::regex_type = basic_regex<CharT, Traits> |
The pattern type.
Definition at line 40 of file regex_iter.hpp.
| using real::compat::regex_iterator< BidirIt, CharT, Traits >::value_type = match_results<BidirIt> |
Yielded match.
Definition at line 35 of file regex_iter.hpp.
|
default |
Constructs the end sentinel.
|
inline |
Constructs a begin iterator over [first, last) and finds the first match. A constraining match flag (see detail::real_honors) routes to the std backend, which carries the flags through the wrapped std::regex_iterator.
Definition at line 48 of file regex_iter.hpp.
|
delete |
Constructing from a temporary regex would dangle (std::regex_iterator parity).
|
inlineprivate |
Advances the real path: next region search from real_pos_.
Definition at line 138 of file regex_iter.hpp.
|
inline |
Definition at line 120 of file regex_iter.hpp.
|
inline |
Definition at line 73 of file regex_iter.hpp.
|
inline |
Definition at line 83 of file regex_iter.hpp.
|
inline |
Definition at line 101 of file regex_iter.hpp.
|
inline |
Definition at line 78 of file regex_iter.hpp.
|
inline |
Definition at line 108 of file regex_iter.hpp.
|
inlineprivate |
Syncs the std path from the wrapped std::regex_iterator.
Definition at line 159 of file regex_iter.hpp.
|
private |
Definition at line 135 of file regex_iter.hpp.
|
private |
Definition at line 127 of file regex_iter.hpp.
|
private |
Definition at line 128 of file regex_iter.hpp.
|
private |
Definition at line 130 of file regex_iter.hpp.
|
private |
Definition at line 134 of file regex_iter.hpp.
|
private |
Definition at line 129 of file regex_iter.hpp.
|
private |
Definition at line 131 of file regex_iter.hpp.
|
private |
Definition at line 132 of file regex_iter.hpp.
|
private |
Definition at line 133 of file regex_iter.hpp.