33namespace std _GLIBCXX_VISIBILITY(default)
35_GLIBCXX_BEGIN_NAMESPACE_VERSION
50 template<
typename _BiIter,
typename _Alloc,
typename _TraitsT,
58 enum class _Match_mode :
unsigned char { _Exact, _Prefix };
65 typedef typename _TraitsT::char_class_type _ClassT;
66 typedef _NFA<_TraitsT> _NFAT;
77 _M_nfa(*__re._M_automaton),
78 _M_results(__results),
79 _M_rep_count(_M_nfa.size()),
80 _M_states(_M_nfa._M_start(), _M_nfa.size()),
83 using namespace regex_constants;
84 if (__flags & match_prev_avail)
85 _M_flags &= ~(match_not_bol | match_not_bow);
92 _M_current = _M_begin;
93 return _M_main(_Match_mode::_Exact);
98 _M_search_from_first()
100 _M_current = _M_begin;
101 return _M_main(_Match_mode::_Prefix);
109 _M_rep_once_more(_Match_mode __match_mode, _StateIdT);
112 _M_handle_repeat(_Match_mode, _StateIdT);
115 _M_handle_subexpr_begin(_Match_mode, _StateIdT);
118 _M_handle_subexpr_end(_Match_mode, _StateIdT);
121 _M_handle_line_begin_assertion(_Match_mode, _StateIdT);
124 _M_handle_line_end_assertion(_Match_mode, _StateIdT);
127 _M_handle_word_boundary(_Match_mode, _StateIdT);
130 _M_handle_subexpr_lookahead(_Match_mode, _StateIdT);
133 _M_handle_match(_Match_mode, _StateIdT);
136 _M_handle_backref(_Match_mode, _StateIdT);
139 _M_handle_accept(_Match_mode, _StateIdT);
142 _M_handle_alternative(_Match_mode, _StateIdT);
145 _M_dfs(_Match_mode __match_mode, _StateIdT __start);
148 _M_main(_Match_mode __match_mode)
152 _M_main_dispatch(_Match_mode __match_mode,
__dfs);
155 _M_main_dispatch(_Match_mode __match_mode,
__bfs);
158 _M_is_word(_CharT __ch)
const
160 static const _CharT __s[2] = {
'w' };
161 return _M_re._M_automaton->_M_traits.isctype
162 (__ch, _M_re._M_automaton->_M_traits.lookup_classname(__s, __s+1));
168 if (_M_current == _M_begin)
178 if (_M_match_multiline())
179 return _M_is_line_terminator(*std::prev(_M_current));
186 else if (_M_match_multiline())
187 return _M_is_line_terminator(*std::prev(_M_current));
195 if (_M_current == _M_end)
197 else if (_M_match_multiline())
198 return _M_is_line_terminator(*_M_current);
204 _M_word_boundary()
const;
207 _M_lookahead(_StateIdT __next);
210 _M_is_line_terminator(_CharT __c)
const
212 const auto& __traits = _M_re._M_automaton->_M_traits;
213 const auto& __ct = use_facet<ctype<_CharT>>(__traits.getloc());
214 const char __n{ __ct.narrow(__c,
' ') };
227 _M_match_multiline()
const noexcept
231 return (_M_re._M_automaton->_M_options() & __m) == __m;
235 template<
typename _SearchMode,
typename _ResultsVec>
238 template<
typename _ResultsVec>
242 _State_info(_StateIdT __start,
size_t __n)
243 : _M_visited_states(
new bool[__n]()), _M_start(__start)
246 bool _M_visited(_StateIdT __i)
248 if (_M_visited_states[__i])
250 _M_visited_states[__i] =
true;
254 void _M_queue(_StateIdT __i,
const _ResultsVec& __res)
255 { _M_match_queue.emplace_back(__i, __res); }
258 _BiIter* _M_get_sol_pos() {
return nullptr; }
268 template<
typename _ResultsVec>
272 _State_info(_StateIdT __start,
size_t) : _M_start(__start)
276 bool _M_visited(_StateIdT)
const {
return false; }
279 _BiIter* _M_get_sol_pos() {
return &_M_sol_pos; }
290 const _BiIter _M_end;
295 _State_info<__search_mode, _ResultsVec> _M_states;
303_GLIBCXX_END_NAMESPACE_VERSION
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
ISO C++ entities toplevel namespace is std.
constexpr match_flag_type match_not_bol
constexpr syntax_option_type ECMAScript
constexpr syntax_option_type __multiline
Extension: Equivalent to regex_constants::multiline for C++11 and C++14.
constexpr match_flag_type match_not_eol
match_flag_type
This is a bitmask type indicating regex matching rules.
constexpr match_flag_type match_prev_avail
Traits class for iterators.
Takes a regex and an input string and does the matching.
A standard container which offers fixed time access to individual elements in any order.
20.7.1.2 unique_ptr for single objects.