2769
2769
void __push_end_marked_subexpression(unsigned);
2770
2770
void __push_empty();
2771
2771
void __push_word_boundary(bool);
2772
void __push_lookahead(const basic_regex&, bool);
2772
void __push_lookahead(const basic_regex&, bool, unsigned);
2774
2774
template <class _Allocator>
2843
2843
const basic_regex<_Cp, _Tp>& __e,
2844
2844
regex_constants::match_flag_type __flags);
2846
template <class _Iter, class _Ap, class _Cp, class _Tp>
2849
regex_search(__wrap_iter<_Iter> __first,
2850
__wrap_iter<_Iter> __last,
2851
match_results<__wrap_iter<_Iter>, _Ap>& __m,
2852
const basic_regex<_Cp, _Tp>& __e,
2853
regex_constants::match_flag_type __flags);
2846
2855
template <class, class> friend class __lookahead;
2906
2916
typedef _VSTD::__state<_CharT> __state;
2908
2918
_LIBCPP_INLINE_VISIBILITY
2909
__lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s)
2910
: base(__s), __exp_(__exp), __invert_(__invert) {}
2919
__lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s, unsigned __mexp)
2920
: base(__s), __exp_(__exp), __invert_(__invert), __mexp_(__mexp) {}
2912
2922
virtual void __exec(__state&) const;
2921
2931
bool __matched = __exp_.__match_at_start_ecma(__s.__current_, __s.__last_,
2923
2933
__s.__flags_ | regex_constants::match_continuous,
2934
__s.__at_first_ && __s.__current_ == __s.__first_);
2925
2935
if (__matched != __invert_)
2927
2937
__s.__do_ = __state::__accept_but_not_consume;
2928
2938
__s.__node_ = this->first();
2939
for (unsigned __i = 1; __i < __m.size(); ++__i) {
2940
__s.__sub_matches_[__mexp_ + __i - 1] = __m.__matches_[__i];
4158
4172
basic_regex __exp;
4159
4173
__exp.__flags_ = __flags_;
4160
4174
__temp = __exp.__parse(++__temp, __last);
4161
__push_lookahead(_VSTD::move(__exp), false);
4175
unsigned __mexp = __exp.__marked_count_;
4176
__push_lookahead(_VSTD::move(__exp), false, __marked_count_);
4177
__marked_count_ += __mexp;
4162
4178
#ifndef _LIBCPP_NO_EXCEPTIONS
4163
4179
if (__temp == __last || *__temp != ')')
4164
4180
throw regex_error(regex_constants::error_paren);
4171
4187
basic_regex __exp;
4172
4188
__exp.__flags_ = __flags_;
4173
4189
__temp = __exp.__parse(++__temp, __last);
4174
__push_lookahead(_VSTD::move(__exp), true);
4190
unsigned __mexp = __exp.__marked_count_;
4191
__push_lookahead(_VSTD::move(__exp), true, __marked_count_);
4192
__marked_count_ += __mexp;
4175
4193
#ifndef _LIBCPP_NO_EXCEPTIONS
4176
4194
if (__temp == __last || *__temp != ')')
4177
4195
throw regex_error(regex_constants::error_paren);
4409
4427
if ((__t = _VSTD::next(__first)) != __last)
4411
if ('A' <= *__t <= 'Z' || 'a' <= *__t <= 'z')
4429
if (('A' <= *__t && *__t <= 'Z') ||
4430
('a' <= *__t && *__t <= 'z'))
4414
4433
*__str = _CharT(*__t % 32);
4416
4435
__push_char(_CharT(*__t % 32));
4417
4436
__first = ++__t;
4438
#ifndef _LIBCPP_NO_EXCEPTIONS
4440
throw regex_error(regex_constants::error_escape);
4441
#endif // _LIBCPP_NO_EXCEPTIONS
4443
#ifndef _LIBCPP_NO_EXCEPTIONS
4445
throw regex_error(regex_constants::error_escape);
4446
#endif // _LIBCPP_NO_EXCEPTIONS
4740
4767
template <class _CharT, class _Traits>
4742
4769
basic_regex<_CharT, _Traits>::__push_lookahead(const basic_regex& __exp,
4745
4773
__end_->first() = new __lookahead<_CharT, _Traits>(__exp, __invert,
4774
__end_->first(), __mexp);
4747
4775
__end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
5764
5792
__m.__init(1 + mark_count(), __first, __last,
5765
5793
__flags & regex_constants::__no_update_pos);
5766
if (__match_at_start(__first, __last, __m, __flags, true))
5794
if (__match_at_start(__first, __last, __m, __flags,
5795
!(__flags & regex_constants::__no_update_pos)))
5768
5797
__m.__prefix_.second = __m[0].first;
5769
5798
__m.__prefix_.matched = __m.__prefix_.first != __m.__prefix_.second;
5800
5829
const basic_regex<_CharT, _Traits>& __e,
5801
5830
regex_constants::match_flag_type __flags = regex_constants::match_default)
5803
basic_string<_CharT> __s(__first, __last);
5804
match_results<const _CharT*> __mc;
5805
bool __r = __e.__search(__s.data(), __s.data() + __s.size(), __mc, __flags);
5832
int __offset = (__flags & regex_constants::match_prev_avail) ? 1 : 0;
5833
basic_string<_CharT> __s(_VSTD::prev(__first, __offset), __last);
5834
match_results<const _CharT*> __mc;
5835
bool __r = __e.__search(__s.data() + __offset, __s.data() + __s.size(), __mc, __flags);
5836
__m.__assign(__first, __last, __mc, __flags & regex_constants::__no_update_pos);
5840
template <class _Iter, class _Allocator, class _CharT, class _Traits>
5841
inline _LIBCPP_INLINE_VISIBILITY
5843
regex_search(__wrap_iter<_Iter> __first,
5844
__wrap_iter<_Iter> __last,
5845
match_results<__wrap_iter<_Iter>, _Allocator>& __m,
5846
const basic_regex<_CharT, _Traits>& __e,
5847
regex_constants::match_flag_type __flags = regex_constants::match_default)
5849
match_results<const _CharT*> __mc;
5850
bool __r = __e.__search(__first.base(), __last.base(), __mc, __flags);
5806
5851
__m.__assign(__first, __last, __mc, __flags & regex_constants::__no_update_pos);