31namespace std _GLIBCXX_VISIBILITY(default)
33_GLIBCXX_BEGIN_NAMESPACE_VERSION
34_GLIBCXX_BEGIN_NAMESPACE_CXX11
35 template<
typename,
typename>
38 template<
typename _Bi_iter,
typename _Alloc>
41_GLIBCXX_END_NAMESPACE_CXX11
45 enum class _RegexExecutorPolicy :
int { _S_auto, _S_alternate };
47 template<
typename _BiIter,
typename _Alloc,
48 typename _CharT,
typename _TraitsT,
49 _RegexExecutorPolicy __policy,
52 __regex_algo_impl(_BiIter __s,
54 match_results<_BiIter, _Alloc>& __m,
55 const basic_regex<_CharT, _TraitsT>& __re,
58 template<
typename,
typename,
typename,
bool>
62_GLIBCXX_BEGIN_NAMESPACE_CXX11
79 template<
typename _Ch_type>
91 unsigned char _M_extended;
92 static constexpr unsigned char _S_under = 1 << 0;
93 static constexpr unsigned char _S_valid_mask = 0x1;
95 constexpr _RegexMask(_BaseType __base = 0,
103 return _RegexMask(_M_base & __other._M_base,
104 _M_extended & __other._M_extended);
110 return _RegexMask(_M_base | __other._M_base,
111 _M_extended | __other._M_extended);
117 return _RegexMask(_M_base ^ __other._M_base,
118 _M_extended ^ __other._M_extended);
123 {
return _RegexMask(~_M_base, ~_M_extended); }
126 operator&=(_RegexMask __other)
127 {
return *
this = (*this) & __other; }
130 operator|=(_RegexMask __other)
131 {
return *
this = (*this) | __other; }
134 operator^=(_RegexMask __other)
135 {
return *
this = (*this) ^ __other; }
138 operator==(_RegexMask __other)
const
140 return (_M_extended & _S_valid_mask)
141 == (__other._M_extended & _S_valid_mask)
142 && _M_base == __other._M_base;
145#if __cpp_impl_three_way_comparison < 201907L
147 operator!=(_RegexMask __other)
const
148 {
return !((*this) == __other); }
153 typedef _RegexMask char_class_type;
173 {
return string_type::traits_type::length(__p); }
223 template<
typename _Fwd_iter>
247 template<
typename _Fwd_iter>
275 template<
typename _Fwd_iter>
316 template<
typename _Fwd_iter>
363 std::swap(_M_locale,
__loc);
373 {
return _M_locale; }
376 locale_type _M_locale;
387 template<
typename _Ch_type,
typename _Rx_traits = regex_traits<_Ch_type>>
392 "regex traits class must have the same char_type");
397 typedef typename traits_type::string_type string_type;
399 typedef typename traits_type::locale_type locale_type;
424 : _M_flags(ECMAScript), _M_loc(), _M_automaton(
nullptr)
483 template<
typename _Ch_traits,
typename _Ch_alloc>
504 template<
typename _FwdIter>
533 {
return this->
assign(__rhs); }
551 {
return this->
assign(__p); }
563 {
return this->
assign(__l.begin(),
__l.end()); }
571 template<
typename _Ch_traits,
typename _Alloc>
574 {
return this->
assign(__s); }
618 {
return this->
assign(string_type(__p), __flags); }
637 {
return this->
assign(string_type(__p,
__len), __flags); }
650 template<
typename _Ch_traits,
typename _Alloc>
672 template<
typename _InputIterator>
676 {
return this->
assign(string_type(__first, __last), __flags); }
691 {
return this->
assign(__l.begin(),
__l.end(), __flags); }
702 return _M_automaton->_M_sub_count() - 1;
723 std::swap(
__loc, _M_loc);
724 _M_automaton.reset();
745 std::swap(_M_flags,
__rhs._M_flags);
746 std::swap(_M_loc,
__rhs._M_loc);
747 std::swap(_M_automaton,
__rhs._M_automaton);
753 { _M_automaton->_M_dot(
__ostr); }
759 template<
typename _FwdIter>
760 basic_regex(_FwdIter __first, _FwdIter __last, locale_type __loc,
762 : _M_flags(__f), _M_loc(
std::
move(__loc)),
763 _M_automaton(__detail::__compile_nfa<_Rx_traits>(
767 template<
typename _Bp,
typename _Ap,
typename _Cp,
typename _Rp,
768 __detail::_RegexExecutorPolicy,
bool>
770 __detail::__regex_algo_impl(_Bp, _Bp, match_results<_Bp, _Ap>&,
771 const basic_regex<_Cp, _Rp>&,
774 template<
typename,
typename,
typename,
bool>
775 friend class __detail::_Executor;
779 _AutomatonPtr _M_automaton;
782#if __cplusplus < 201703L
783 template<
typename _Ch,
typename _Tr>
785 basic_regex<_Ch, _Tr>::icase;
787 template<
typename _Ch,
typename _Tr>
789 basic_regex<_Ch, _Tr>::nosubs;
791 template<
typename _Ch,
typename _Tr>
793 basic_regex<_Ch, _Tr>::optimize;
795 template<
typename _Ch,
typename _Tr>
797 basic_regex<_Ch, _Tr>::collate;
799 template<
typename _Ch,
typename _Tr>
801 basic_regex<_Ch, _Tr>::ECMAScript;
803 template<
typename _Ch,
typename _Tr>
805 basic_regex<_Ch, _Tr>::basic;
807 template<
typename _Ch,
typename _Tr>
809 basic_regex<_Ch, _Tr>::extended;
811 template<
typename _Ch,
typename _Tr>
813 basic_regex<_Ch, _Tr>::awk;
815 template<
typename _Ch,
typename _Tr>
817 basic_regex<_Ch, _Tr>::grep;
819 template<
typename _Ch,
typename _Tr>
821 basic_regex<_Ch, _Tr>::egrep;
824#if __cpp_deduction_guides >= 201606
825 template<
typename _ForwardIterator>
826 basic_regex(_ForwardIterator, _ForwardIterator,
828 -> basic_regex<
typename iterator_traits<_ForwardIterator>::value_type>;
834#ifdef _GLIBCXX_USE_WCHAR_T
847 template<
typename _Ch_type,
typename _Rx_traits>
867 template<
typename _BiIter>
873 typedef typename __iter_traits::value_type value_type;
874 typedef typename __iter_traits::difference_type difference_type;
875 typedef _BiIter iterator;
897 operator string_type()
const
924 {
return this->_M_str().compare(
__s._M_str()); }
938 {
return this->_M_str().compare(
__s); }
942 {
return this->_M_str().compare(
__s); }
948 _M_compare(
const value_type*
__s,
size_t __n)
const
949 {
return this->_M_str().compare({
__s, __n}); }
956 using traits_type =
typename string_type::traits_type;
958 __string_view() =
default;
960 __string_view(
const value_type* __s,
size_t __n) noexcept
961 : _M_data(__s), _M_len(__n) { }
963 __string_view(
const value_type* __s) noexcept
964 : _M_data(__s), _M_len(traits_type::length(__s)) { }
966 __string_view(
const string_type& __s) noexcept
967 : _M_data(__s.data()), _M_len(__s.length()) { }
970 compare(__string_view __s)
const noexcept
972 if (
const size_t __n =
std::min(_M_len, __s._M_len))
973 if (
int __ret = traits_type::compare(_M_data, __s._M_data, __n))
975 const difference_type __diff = _M_len - __s._M_len;
980 return static_cast<int>(__diff);
984 const value_type* _M_data =
nullptr;
989 template<
typename _Iter = _BiIter>
990 __enable_if_t<__detail::__is_contiguous_iter<_Iter>::value,
992 _M_str() const noexcept
1001 template<
typename _Iter = _BiIter>
1002 __enable_if_t<!__detail::__is_contiguous_iter<_Iter>::value,
1015#ifdef _GLIBCXX_USE_WCHAR_T
1033 template<
typename _BiIter>
1038#if __cpp_lib_three_way_comparison
1046 template<
typename _BiIter>
1050 noexcept(__detail::__is_contiguous_iter<_BiIter>::value)
1053 return __detail::__char_traits_cmp_cat<_Tr>(
__lhs.compare(
__rhs));
1062 template<
typename _BiIter>
1073 template<
typename _BiIter>
1084 template<
typename _BiIter>
1095 template<
typename _BiIter>
1106 template<
typename _BiIter>
1115 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1121#if ! __cpp_lib_three_way_comparison
1129 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1142 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1154 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1166 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1178 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1190 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1204 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1210#if __cpp_lib_three_way_comparison
1218 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Alloc>
1222 noexcept(__detail::__is_contiguous_iter<_Bi_iter>::value)
1224 return __detail::__char_traits_cmp_cat<_Ch_traits>(
1235 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1247 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1259 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1271 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1283 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1296 template<
typename _Bi_iter>
1309 template<
typename _Bi_iter>
1321 template<
typename _Bi_iter>
1333 template<
typename _Bi_iter>
1345 template<
typename _Bi_iter>
1357 template<
typename _Bi_iter>
1371 template<
typename _Bi_iter>
1377#if __cpp_lib_three_way_comparison
1386 template<
typename _Bi_iter>
1390 noexcept(__detail::__is_contiguous_iter<_Bi_iter>::value)
1393 return __detail::__char_traits_cmp_cat<_Tr>(
__lhs.compare(
__rhs));
1403 template<
typename _Bi_iter>
1415 template<
typename _Bi_iter>
1427 template<
typename _Bi_iter>
1439 template<
typename _Bi_iter>
1451 template<
typename _Bi_iter>
1464 template<
typename _Bi_iter>
1477 template<
typename _Bi_iter>
1490 template<
typename _Bi_iter>
1503 template<
typename _Bi_iter>
1516 template<
typename _Bi_iter>
1529 template<
typename _Bi_iter>
1543 template<
typename _Bi_iter>
1549#if __cpp_lib_three_way_comparison
1559 template<
typename _Bi_iter>
1563 noexcept(__detail::__is_contiguous_iter<_Bi_iter>::value)
1566 return __detail::__char_traits_cmp_cat<_Tr>(
1577 template<
typename _Bi_iter>
1590 template<
typename _Bi_iter>
1603 template<
typename _Bi_iter>
1616 template<
typename _Bi_iter>
1629 template<
typename _Bi_iter>
1644 template<
typename _Ch_type,
typename _Ch_traits,
typename _Bi_iter>
1675 template<
typename _Bi_iter,
1676 typename _Alloc = allocator<sub_match<_Bi_iter> > >
1678 :
private std::vector<sub_match<_Bi_iter>, _Alloc>
1709 typedef typename _Base_type::const_iterator const_iterator;
1710 typedef const_iterator iterator;
1711 typedef typename __iter_traits::difference_type difference_type;
1713 typedef _Alloc allocator_type;
1714 typedef typename __iter_traits::value_type char_type;
1792 {
return _Base_type::empty() ? 0 : _Base_type::size() - 3; }
1796 {
return _Base_type::max_size() - 3; }
1803 _GLIBCXX_NODISCARD
bool
1805 {
return _Base_type::size() <= 3; }
1824 {
return (*
this)[
__sub].length(); }
1868 __glibcxx_assert(
ready() );
1870 ? _Base_type::operator[](
__sub)
1885 __glibcxx_assert(
ready() );
1900 __glibcxx_assert(
ready() );
1909 {
return _Base_type::begin(); }
1916 {
return this->
begin(); }
1923 {
return _Base_type::end() - (_Base_type::empty() ? 0 : 3); }
1930 {
return this->
end(); }
1947 template<
typename _Out_iter>
1956 template<
typename _Out_iter,
typename _St,
typename _Sa>
1968 template<
typename _St,
typename _Sa>
2005 {
return _Base_type::get_allocator(); }
2021 _Base_type::swap(
__that);
2027 template<
typename,
typename,
typename>
2032 template<
typename,
typename,
typename,
bool>
2035 template<
typename _Bp,
typename _Ap,
typename _Cp,
typename _Rp,
2036 __detail::_RegexExecutorPolicy,
bool>
2045 _M_resize(
unsigned int __size)
2050 _M_establish_failed_match(_Bi_iter __end)
2052 sub_match<_Bi_iter> __sm;
2053 __sm.first = __sm.second = __end;
2054 _Base_type::assign(3, __sm);
2058 _M_unmatched_sub()
const
2059 {
return _Base_type::operator[](_Base_type::size() - 3); }
2061 sub_match<_Bi_iter>&
2063 {
return _Base_type::operator[](_Base_type::size() - 3); }
2067 {
return _Base_type::operator[](_Base_type::size() - 2); }
2069 sub_match<_Bi_iter>&
2071 {
return _Base_type::operator[](_Base_type::size() - 2); }
2075 {
return _Base_type::operator[](_Base_type::size() - 1); }
2077 sub_match<_Bi_iter>&
2079 {
return _Base_type::operator[](_Base_type::size() - 1); }
2081 _Bi_iter _M_begin {};
2085 typedef match_results<const char*> cmatch;
2086 typedef match_results<string::const_iterator> smatch;
2087#ifdef _GLIBCXX_USE_WCHAR_T
2088 typedef match_results<const wchar_t*> wcmatch;
2089 typedef match_results<wstring::const_iterator> wsmatch;
2099 template<
typename _Bi_iter,
typename _Alloc>
2112 return __m1.prefix() ==
__m2.prefix()
2118#if ! __cpp_lib_three_way_comparison
2124 template<
typename _Bi_iter,
class _Alloc>
2139 template<
typename _Bi_iter,
typename _Alloc>
2145_GLIBCXX_END_NAMESPACE_CXX11
2168 template<
typename _Bi_iter,
typename _Alloc,
2169 typename _Ch_type,
typename _Rx_traits>
2179 __detail::_RegexExecutorPolicy::_S_auto,
true>
2197 template<
typename _Bi_iter,
typename _Ch_type,
typename _Rx_traits>
2222 template<
typename _Ch_type,
typename _Alloc,
typename _Rx_traits>
2245 template<
typename _Ch_traits,
typename _Ch_alloc,
2246 typename _Alloc,
typename _Ch_type,
typename _Rx_traits>
2259 template<
typename _Ch_traits,
typename _Ch_alloc,
2260 typename _Alloc,
typename _Ch_type,
typename _Rx_traits>
2282 template<
typename _Ch_type,
class _Rx_traits>
2303 template<
typename _Ch_traits,
typename _Str_allocator,
2304 typename _Ch_type,
typename _Rx_traits>
2326 template<
typename _Bi_iter,
typename _Alloc,
2327 typename _Ch_type,
typename _Rx_traits>
2336 __detail::_RegexExecutorPolicy::_S_auto,
false>
2351 template<
typename _Bi_iter,
typename _Ch_type,
typename _Rx_traits>
2374 template<
typename _Ch_type,
class _Alloc,
class _Rx_traits>
2393 template<
typename _Ch_type,
typename _Rx_traits>
2411 template<
typename _Ch_traits,
typename _String_allocator,
2412 typename _Ch_type,
typename _Rx_traits>
2433 template<
typename _Ch_traits,
typename _Ch_alloc,
2434 typename _Alloc,
typename _Ch_type,
2435 typename _Rx_traits>
2448 template<
typename _Ch_traits,
typename _Ch_alloc,
2449 typename _Alloc,
typename _Ch_type,
2450 typename _Rx_traits>
2461 template<
typename _Out_iter,
typename _Bi_iter,
2482 template<
typename _Out_iter,
typename _Bi_iter,
2484 typename _St,
typename _Sa>
2493 __fmt.length(), __flags);
2509 template<
typename _Out_iter,
typename _Bi_iter,
2510 typename _Rx_traits,
typename _Ch_type>
2535 template<
typename _Rx_traits,
typename _Ch_type,
2536 typename _St,
typename _Sa,
typename _Fst,
typename _Fsa>
2537 inline basic_string<_Ch_type, _St, _Sa>
2561 template<
typename _Rx_traits,
typename _Ch_type,
2562 typename _St,
typename _Sa>
2563 inline basic_string<_Ch_type, _St, _Sa>
2587 template<
typename _Rx_traits,
typename _Ch_type,
2588 typename _St,
typename _Sa>
2589 inline basic_string<_Ch_type>
2599 __e,
__fmt, __flags);
2614 template<
typename _Rx_traits,
typename _Ch_type>
2615 inline basic_string<_Ch_type>
2625 __e,
__fmt, __flags);
2631_GLIBCXX_BEGIN_NAMESPACE_CXX11
2638 template<
typename _Bi_iter,
2639 typename _Ch_type =
typename iterator_traits<_Bi_iter>::value_type,
2640 typename _Rx_traits = regex_traits<_Ch_type> >
2647 typedef const value_type* pointer;
2648 typedef const value_type& reference;
2667 : _M_begin(__a), _M_end(__b), _M_pregex(&
__re), _M_flags(
__m), _M_match()
2669 if (!
regex_search(_M_begin, _M_end, _M_match, *_M_pregex, _M_flags))
2699 {
return !(*
this ==
__rhs); }
2706 {
return _M_match; }
2713 {
return &_M_match; }
2733 _Bi_iter _M_begin {};
2735 const regex_type* _M_pregex =
nullptr;
2737 match_results<_Bi_iter> _M_match;
2740 typedef regex_iterator<const char*> cregex_iterator;
2741 typedef regex_iterator<string::const_iterator> sregex_iterator;
2742#ifdef _GLIBCXX_USE_WCHAR_T
2743 typedef regex_iterator<const wchar_t*> wcregex_iterator;
2744 typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
2755 template<
typename _Bi_iter,
2756 typename _Ch_type =
typename iterator_traits<_Bi_iter>::value_type,
2757 typename _Rx_traits = regex_traits<_Ch_type> >
2777 : _M_position(), _M_subs(), _M_suffix(), _M_n(0), _M_result(
nullptr),
2803 { _M_init(__a, __b); }
2820 { _M_init(__a, __b); }
2837 { _M_init(__a, __b); }
2848 template<std::
size_t _Nm>
2854 : _M_position(__a, __b,
__re,
__m),
2856 { _M_init(__a, __b); }
2871 template <std::
size_t _Nm>
2882 : _M_position(
__rhs._M_position), _M_subs(
__rhs._M_subs),
2883 _M_suffix(
__rhs._M_suffix), _M_n(
__rhs._M_n), _M_has_m1(
__rhs._M_has_m1)
2884 { _M_normalize_result(); }
2904 {
return !(*
this ==
__rhs); }
2911 {
return *_M_result; }
2918 {
return _M_result; }
2941 _M_init(_Bi_iter __a, _Bi_iter __b);
2944 _M_current_match()
const
2946 if (_M_subs[_M_n] == -1)
2947 return (*_M_position).prefix();
2949 return (*_M_position)[_M_subs[_M_n]];
2953 _M_end_of_seq()
const
2954 {
return _M_result ==
nullptr; }
2958 _M_normalize_result()
2960 if (_M_position != _Position())
2961 _M_result = &_M_current_match();
2963 _M_result = &_M_suffix;
2965 _M_result =
nullptr;
2968 _Position _M_position;
2970 value_type _M_suffix;
2972 const value_type* _M_result;
2984#ifdef _GLIBCXX_USE_WCHAR_T
2994_GLIBCXX_END_NAMESPACE_CXX11
2995_GLIBCXX_END_NAMESPACE_VERSION
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
_Tp * end(valarray< _Tp > &__va) noexcept
Return an iterator pointing to one past the last element of the valarray.
_Tp * begin(valarray< _Tp > &__va) noexcept
Return an iterator pointing to the first element of the valarray.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
bool operator>=(typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the ordering of a character and a regular expression submatch.
_Out_iter __regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last, const basic_regex< _Ch_type, _Rx_traits > &__e, const _Ch_type *__fmt, size_t __len, regex_constants::match_flag_type __flags)
Determines if there is a match between the regular expression e and all of the character sequence [fi...
sub_match< wstring::const_iterator > wssub_match
Regex submatch over a standard wide string.
bool operator!=(const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
Tests the inequivalence of a regular expression submatch and a character.
sub_match< string::const_iterator > ssub_match
Standard regex submatch over a standard string.
bool operator==(const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the equivalence of a string and a regular expression submatch.
bool operator!=(const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the inequivalence of a string and a regular expression submatch.
sub_match< const char * > csub_match
Standard regex submatch over a C-style null-terminated string.
regex_token_iterator< const char * > cregex_token_iterator
Token iterator for C-style NULL-terminated strings.
bool operator==(const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
Tests the equivalence of a regular expression submatch and a string.
bool operator>=(const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the ordering of a string and a regular expression submatch.
regex_token_iterator< wstring::const_iterator > wsregex_token_iterator
Token iterator for standard wide-character strings.
bool operator==(const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
Tests the equivalence of a regular expression submatch and a character.
bool operator>=(const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
Tests the ordering of a regular expression submatch and a C string.
bool operator==(const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
Tests the equivalence of a regular expression submatch and a C string.
bool operator!=(const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
Tests the inequivalence of a regular expression submatch and a string.
bool operator!=(typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the inequivalence of a C string and a regular expression submatch.
regex_token_iterator< const wchar_t * > wcregex_token_iterator
Token iterator for C-style NULL-terminated wide strings.
void swap(basic_regex< _Ch_type, _Rx_traits > &__lhs, basic_regex< _Ch_type, _Rx_traits > &__rhs) noexcept
Swaps the contents of two regular expression objects.
bool operator>(const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
Tests the ordering of a regular expression submatch and a character.
bool operator>(const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
Tests the ordering of a regular expression submatch and a C string.
bool operator>=(const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
Tests the ordering of a regular expression submatch and a character.
bool operator>(typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the ordering of a character and a regular expression submatch.
basic_regex< char > regex
Standard regular expressions.
_Out_iter regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last, const basic_regex< _Ch_type, _Rx_traits > &__e, const basic_string< _Ch_type, _St, _Sa > &__fmt, regex_constants::match_flag_type __flags=regex_constants::match_default)
Search for a regular expression within a range for multiple times, and replace the matched parts thro...
sub_match< const wchar_t * > wcsub_match
Regex submatch over a C-style null-terminated wide string.
regex_token_iterator< string::const_iterator > sregex_token_iterator
Token iterator for standard strings.
bool operator>=(const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
Tests the ordering of a regular expression submatch and a string.
bool regex_match(_Bi_iter __s, _Bi_iter __e, match_results< _Bi_iter, _Alloc > &__m, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __flags=regex_constants::match_default)
Determines if there is a match between the regular expression e and all of the character sequence [fi...
bool regex_search(_Bi_iter __s, _Bi_iter __e, match_results< _Bi_iter, _Alloc > &__m, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __flags=regex_constants::match_default)
bool operator>(const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
Tests the ordering of a regular expression submatch and a string.
bool operator>(typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the ordering of a C string and a regular expression submatch.
bool operator>=(const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
Tests the ordering of two regular expression submatches.
bool operator>(const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
Tests the ordering of two regular expression submatches.
bool operator==(typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the equivalence of a character and a regular expression submatch.
bool operator>(const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the ordering of a string and a regular expression submatch.
bool operator!=(typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the inequivalence of a character and a regular expression submatch.
basic_regex< wchar_t > wregex
Standard wide-character regular expressions.
bool operator==(typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the equivalence of a C string and a regular expression submatch.
bool operator==(const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
Tests the equivalence of two regular expression submatches.
bool operator!=(const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
Tests the inequivalence of two regular expression submatches.
bool operator!=(const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
Tests the inequivalence of a regular expression submatch and a string.
bool operator>=(typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
Tests the ordering of a C string and a regular expression submatch.
constexpr back_insert_iterator< _Container > back_inserter(_Container &__x)
ISO C++ entities toplevel namespace is std.
bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
constexpr syntax_option_type collate
constexpr syntax_option_type ECMAScript
constexpr syntax_option_type egrep
syntax_option_type
This is a bitmask type indicating how to interpret the regex.
constexpr match_flag_type match_default
constexpr syntax_option_type awk
constexpr syntax_option_type extended
constexpr syntax_option_type basic
match_flag_type
This is a bitmask type indicating regex matching rules.
constexpr syntax_option_type icase
constexpr syntax_option_type optimize
constexpr match_flag_type format_default
constexpr syntax_option_type nosubs
constexpr syntax_option_type grep
Properties of fundamental types.
static constexpr _Tp max() noexcept
static constexpr _Tp min() noexcept
typename _Size< _Alloc, difference_type >::type size_type
The allocator's size type.
Managing sequences of characters and character-like objects.
Basis for explicit traits specializations.
Traits class for iterators.
Container class for localization functionality.
Facet for localized string comparison.
basic_regex & assign(const _Ch_type *__p, flag_type __flags=ECMAScript)
Assigns a new regular expression to a regex object from a C-style null-terminated string containing a...
basic_regex & assign(const _Ch_type *__p, size_t __len, flag_type __flags=ECMAScript)
Assigns a new regular expression to a regex object from a C-style string containing a regular express...
locale_type getloc() const noexcept
Gets the locale currently imbued in the regular expression object.
basic_regex & operator=(const basic_regex &__rhs)
Assigns one regular expression to another.
unsigned int mark_count() const noexcept
Gets the number of marked subexpressions within the regular expression.
basic_regex & assign(_InputIterator __first, _InputIterator __last, flag_type __flags=ECMAScript)
Assigns a new regular expression to a regex object.
locale_type imbue(locale_type __loc)
Imbues the regular expression object with the given locale.
basic_regex(const basic_regex &__rhs)=default
Copy-constructs a basic regular expression.
basic_regex & assign(initializer_list< _Ch_type > __l, flag_type __flags=ECMAScript)
Assigns a new regular expression to a regex object.
basic_regex & assign(basic_regex &&__rhs) noexcept
The move-assignment operator.
flag_type flags() const noexcept
Gets the flags used to construct the regular expression or in the last call to assign().
basic_regex & assign(const basic_regex &__rhs)
the real assignment operator.
basic_regex(const _Ch_type *__p, flag_type __f=ECMAScript)
Constructs a basic regular expression from the sequence [__p, __p + char_traits<_Ch_type>::length(__p...
void swap(basic_regex &__rhs) noexcept
Swaps the contents of two regular expression objects.
basic_regex(const std::basic_string< _Ch_type, _Ch_traits, _Ch_alloc > &__s, flag_type __f=ECMAScript)
Constructs a basic regular expression from the string s interpreted according to the flags in f.
basic_regex(_FwdIter __first, _FwdIter __last, flag_type __f=ECMAScript)
Constructs a basic regular expression from the range [first, last) interpreted according to the flags...
basic_regex(const _Ch_type *__p, std::size_t __len, flag_type __f=ECMAScript)
Constructs a basic regular expression from the sequence [p, p + len) interpreted according to the fla...
basic_regex & operator=(initializer_list< _Ch_type > __l)
Replaces a regular expression with a new one constructed from an initializer list.
basic_regex & assign(const basic_string< _Ch_type, _Ch_traits, _Alloc > &__s, flag_type __flags=ECMAScript)
Assigns a new regular expression to a regex object from a string containing a regular expression patt...
basic_regex & operator=(basic_regex &&__rhs) noexcept
Move-assigns one regular expression to another.
basic_regex(basic_regex &&__rhs) noexcept=default
Move-constructs a basic regular expression.
basic_regex(initializer_list< _Ch_type > __l, flag_type __f=ECMAScript)
Constructs a basic regular expression from an initializer list.
basic_regex & operator=(const _Ch_type *__p)
Replaces a regular expression with a new one constructed from a C-style null-terminated string.
basic_regex & operator=(const basic_string< _Ch_type, _Ch_traits, _Alloc > &__s)
Replaces a regular expression with a new one constructed from a string.
~basic_regex()
Destroys a basic regular expression.
The results of a match or search operation.
allocator_type get_allocator() const noexcept
Gets a copy of the allocator.
void swap(match_results &__that) noexcept
Swaps the contents of two match_results.
difference_type position(size_type __sub=0) const
Gets the offset of the beginning of the indicated submatch.
size_type size() const noexcept
Gets the number of matches and submatches.
_Out_iter format(_Out_iter __out, const char_type *__fmt_first, const char_type *__fmt_last, match_flag_type __flags=regex_constants::format_default) const
difference_type length(size_type __sub=0) const
Gets the length of the indicated submatch.
const_reference prefix() const
Gets a sub_match representing the match prefix.
size_type max_size() const noexcept
Gets the number of matches and submatches.
basic_string< char_type, _St, _Sa > format(const basic_string< char_type, _St, _Sa > &__fmt, match_flag_type __flags=regex_constants::format_default) const
const_reference operator[](size_type __sub) const
Gets a sub_match reference for the match or submatch.
match_results(match_results &&) noexcept=default
Move constructs a match_results.
match_results(const _Alloc &__a) noexcept
Constructs a default match_results container.
match_results(const match_results &)=default
Copy constructs a match_results.
_Out_iter format(_Out_iter __out, const basic_string< char_type, _St, _Sa > &__fmt, match_flag_type __flags=regex_constants::format_default) const
const_iterator cbegin() const noexcept
Gets an iterator to the start of the sub_match collection.
string_type str(size_type __sub=0) const
Gets the match or submatch converted to a string type.
const_iterator end() const noexcept
Gets an iterator to one-past-the-end of the collection.
const_reference suffix() const
Gets a sub_match representing the match suffix.
bool ready() const noexcept
Indicates if the match_results is ready.
bool empty() const noexcept
Indicates if the match_results contains no results.
string_type format(const char_type *__fmt, match_flag_type __flags=regex_constants::format_default) const
match_results()
Constructs a default match_results container.
const_iterator cend() const noexcept
Gets an iterator to one-past-the-end of the collection.
const_iterator begin() const noexcept
Gets an iterator to the start of the sub_match collection.
Takes a regex and an input string and does the matching.
Describes aspects of a regular expression.
char_type translate(char_type __c) const
Performs the identity translation.
string_type lookup_collatename(_Fwd_iter __first, _Fwd_iter __last) const
Gets a collation element by name.
char_class_type lookup_classname(_Fwd_iter __first, _Fwd_iter __last, bool __icase=false) const
Maps one or more characters to a named character classification.
static std::size_t length(const char_type *__p)
Gives the length of a C-style string starting at __p.
string_type transform_primary(_Fwd_iter __first, _Fwd_iter __last) const
Gets a sort key for a character sequence, independent of case.
regex_traits()
Constructs a default traits object.
int value(_Ch_type __ch, int __radix) const
Converts a digit to an int.
char_type translate_nocase(char_type __c) const
Translates a character into a case-insensitive equivalent.
locale_type getloc() const
Gets a copy of the current locale in use by the regex_traits object.
bool isctype(_Ch_type __c, char_class_type __f) const
Determines if c is a member of an identified class.
locale_type imbue(locale_type __loc)
Imbues the regex_traits object with a copy of a new locale.
string_type transform(_Fwd_iter __first, _Fwd_iter __last) const
Gets a sort key for a character sequence.
difference_type length() const noexcept
Gets the length of the matching sequence.
int compare(const value_type *__s) const
Compares this sub_match to a string.
string_type str() const
Gets the matching sequence as a string.
int compare(const sub_match &__s) const
Compares this and another matched sequence.
int compare(const string_type &__s) const
Compares this sub_match to a string.
bool operator!=(const regex_iterator &__rhs) const noexcept
Tests the inequivalence of two regex iterators.
const value_type * operator->() const noexcept
Selects a regex_iterator member.
regex_iterator operator++(int)
Postincrements a regex_iterator.
regex_iterator(_Bi_iter __a, _Bi_iter __b, const regex_type &__re, regex_constants::match_flag_type __m=regex_constants::match_default)
regex_iterator(const regex_iterator &)=default
Copy constructs a regex_iterator.
regex_iterator & operator=(const regex_iterator &)=default
Copy assigns one regex_iterator to another.
regex_iterator()=default
Provides a singular iterator, useful for indicating one-past-the-end of a range.
const value_type & operator*() const noexcept
Dereferences a regex_iterator.
regex_iterator & operator++()
Increments a regex_iterator.
bool operator==(const regex_iterator &) const noexcept
Tests the equivalence of two regex iterators.
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)
bool operator==(const regex_token_iterator &__rhs) const
Compares a regex_token_iterator to another for equality.
regex_token_iterator & operator++()
Increments a regex_token_iterator.
regex_token_iterator(const regex_token_iterator &__rhs)
Copy constructs a regex_token_iterator.
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)
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)
bool operator!=(const regex_token_iterator &__rhs) const
Compares a regex_token_iterator to another for inequality.
regex_token_iterator operator++(int)
Postincrements a regex_token_iterator.
const value_type * operator->() const
Selects a regex_token_iterator member.
regex_token_iterator()
Default constructs a regex_token_iterator.
regex_token_iterator & operator=(const regex_token_iterator &__rhs)
Assigns a regex_token_iterator to another.
const value_type & operator*() const
Dereferences a regex_token_iterator.
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)
Forward iterators support a superset of input iterator operations.
Struct holding two objects of arbitrary type.
_BiIter first
The first member.
_BiIter second
The second member.
A standard container which offers fixed time access to individual elements in any order.