31namespace std _GLIBCXX_VISIBILITY(default)
33_GLIBCXX_BEGIN_NAMESPACE_VERSION
34_GLIBCXX_BEGIN_NAMESPACE_CXX11
35 template<
typename,
typename>
38 template<
typename,
typename>
41_GLIBCXX_END_NAMESPACE_CXX11
42_GLIBCXX_END_NAMESPACE_VERSION
46_GLIBCXX_BEGIN_NAMESPACE_VERSION
48 enum class _RegexExecutorPolicy :
int
49 { _S_auto, _S_alternate };
51 template<
typename _BiIter,
typename _Alloc,
52 typename _CharT,
typename _TraitsT,
53 _RegexExecutorPolicy __policy,
56 __regex_algo_impl(_BiIter __s,
58 match_results<_BiIter, _Alloc>& __m,
59 const basic_regex<_CharT, _TraitsT>& __re,
62 template<
typename,
typename,
typename,
bool>
65_GLIBCXX_END_NAMESPACE_VERSION
68_GLIBCXX_BEGIN_NAMESPACE_VERSION
69_GLIBCXX_BEGIN_NAMESPACE_CXX11
86 template<
typename _Ch_type>
98 unsigned char _M_extended;
99 static constexpr unsigned char _S_under = 1 << 0;
100 static constexpr unsigned char _S_valid_mask = 0x1;
102 constexpr _RegexMask(_BaseType __base = 0,
110 return _RegexMask(_M_base & __other._M_base,
111 _M_extended & __other._M_extended);
115 operator|(_RegexMask __other)
const
117 return _RegexMask(_M_base | __other._M_base,
118 _M_extended | __other._M_extended);
122 operator^(_RegexMask __other)
const
124 return _RegexMask(_M_base ^ __other._M_base,
125 _M_extended ^ __other._M_extended);
130 {
return _RegexMask(~_M_base, ~_M_extended); }
133 operator&=(_RegexMask __other)
134 {
return *
this = (*this) & __other; }
137 operator|=(_RegexMask __other)
138 {
return *
this = (*this) | __other; }
141 operator^=(_RegexMask __other)
142 {
return *
this = (*this) ^ __other; }
145 operator==(_RegexMask __other)
const
147 return (_M_extended & _S_valid_mask)
148 == (__other._M_extended & _S_valid_mask)
149 && _M_base == __other._M_base;
153 operator!=(_RegexMask __other)
const
154 {
return !((*this) == __other); }
158 typedef _RegexMask char_class_type;
178 {
return string_type::traits_type::length(__p); }
228 template<
typename _Fwd_iter>
252 template<
typename _Fwd_iter>
280 template<
typename _Fwd_iter>
321 template<
typename _Fwd_iter>
368 std::swap(_M_locale,
__loc);
378 {
return _M_locale; }
381 locale_type _M_locale;
392 template<
typename _Ch_type,
typename _Rx_traits = regex_traits<_Ch_type>>
396 static_assert(is_same<_Ch_type, typename _Rx_traits::char_type>::value,
397 "regex traits class must have the same char_type");
402 typedef typename traits_type::string_type string_type;
404 typedef typename traits_type::locale_type locale_type;
488 template<
typename _Ch_traits,
typename _Ch_alloc>
509 template<
typename _FwdIter>
538 {
return this->
assign(__rhs); }
556 {
return this->
assign(__p); }
568 {
return this->
assign(__l.begin(),
__l.end()); }
576 template<
typename _Ch_traits,
typename _Alloc>
579 {
return this->
assign(__s); }
623 {
return this->
assign(string_type(__p), __flags); }
640 {
return this->
assign(string_type(__p,
__len), __flags); }
653 template<
typename _Ch_traits,
typename _Alloc>
675 template<
typename _InputIterator>
679 {
return this->
assign(string_type(__first, __last), __flags); }
694 {
return this->
assign(__l.begin(),
__l.end(), __flags); }
705 return _M_automaton->_M_sub_count() - 1;
726 std::swap(
__loc, _M_loc);
727 _M_automaton.reset();
748 std::swap(_M_flags,
__rhs._M_flags);
749 std::swap(_M_loc,
__rhs._M_loc);
750 std::swap(_M_automaton,
__rhs._M_automaton);
756 { _M_automaton->_M_dot(
__ostr); }
762 template<
typename _FwdIter>
763 basic_regex(_FwdIter __first, _FwdIter __last, locale_type __loc,
765 : _M_flags(__f), _M_loc(
std::move(__loc)),
766 _M_automaton(__detail::__compile_nfa<_FwdIter, _Rx_traits>(
767 std::move(__first),
std::move(__last), _M_loc, _M_flags))
770 template<
typename _Bp,
typename _Ap,
typename _Cp,
typename _Rp,
771 __detail::_RegexExecutorPolicy,
bool>
772 friend bool __detail::
773#if _GLIBCXX_INLINE_VERSION
780 template<
typename,
typename,
typename,
bool>
788 template<
typename _Ch,
typename _Tr>
792 template<
typename _Ch,
typename _Tr>
796 template<
typename _Ch,
typename _Tr>
800 template<
typename _Ch,
typename _Tr>
804 template<
typename _Ch,
typename _Tr>
808 template<
typename _Ch,
typename _Tr>
812 template<
typename _Ch,
typename _Tr>
816 template<
typename _Ch,
typename _Tr>
820 template<
typename _Ch,
typename _Tr>
824 template<
typename _Ch,
typename _Tr>
831#ifdef _GLIBCXX_USE_WCHAR_T
843 template<
typename _Ch_type,
typename _Rx_traits>
863 template<
typename _BiIter>
869 typedef typename __iter_traits::value_type value_type;
870 typedef typename __iter_traits::difference_type difference_type;
871 typedef _BiIter iterator;
895 operator string_type()
const
962#ifdef _GLIBCXX_USE_WCHAR_T
978 template<
typename _BiIter>
989 template<
typename _BiIter>
1000 template<
typename _BiIter>
1011 template<
typename _BiIter>
1022 template<
typename _BiIter>
1033 template<
typename _BiIter>
1039 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1040 using __sub_match_string = basic_string<
1041 typename iterator_traits<_Bi_iter>::value_type,
1042 _Ch_traits, _Ch_alloc>;
1051 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1067 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1079 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1094 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1106 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1118 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1131 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1147 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1159 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1174 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1186 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1198 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1211 template<
typename _Bi_iter>
1213 operator==(
typename iterator_traits<_Bi_iter>::value_type
const*
__lhs,
1224 template<
typename _Bi_iter>
1226 operator!=(
typename iterator_traits<_Bi_iter>::value_type
const*
__lhs,
1236 template<
typename _Bi_iter>
1238 operator<(
typename iterator_traits<_Bi_iter>::value_type
const*
__lhs,
1248 template<
typename _Bi_iter>
1250 operator>(
typename iterator_traits<_Bi_iter>::value_type
const*
__lhs,
1260 template<
typename _Bi_iter>
1262 operator>=(
typename iterator_traits<_Bi_iter>::value_type
const*
__lhs,
1272 template<
typename _Bi_iter>
1274 operator<=(
typename iterator_traits<_Bi_iter>::value_type
const*
__lhs,
1285 template<
typename _Bi_iter>
1288 typename iterator_traits<_Bi_iter>::value_type
const*
__rhs)
1298 template<
typename _Bi_iter>
1301 typename iterator_traits<_Bi_iter>::value_type
const*
__rhs)
1310 template<
typename _Bi_iter>
1313 typename iterator_traits<_Bi_iter>::value_type
const*
__rhs)
1322 template<
typename _Bi_iter>
1325 typename iterator_traits<_Bi_iter>::value_type
const*
__rhs)
1334 template<
typename _Bi_iter>
1337 typename iterator_traits<_Bi_iter>::value_type
const*
__rhs)
1346 template<
typename _Bi_iter>
1349 typename iterator_traits<_Bi_iter>::value_type
const*
__rhs)
1359 template<
typename _Bi_iter>
1361 operator==(
typename iterator_traits<_Bi_iter>::value_type
const&
__lhs,
1365 return __rhs.compare(string_type(1,
__lhs)) == 0;
1375 template<
typename _Bi_iter>
1377 operator!=(
typename iterator_traits<_Bi_iter>::value_type
const&
__lhs,
1387 template<
typename _Bi_iter>
1389 operator<(
typename iterator_traits<_Bi_iter>::value_type
const&
__lhs,
1393 return __rhs.compare(string_type(1,
__lhs)) > 0;
1402 template<
typename _Bi_iter>
1404 operator>(
typename iterator_traits<_Bi_iter>::value_type
const&
__lhs,
1414 template<
typename _Bi_iter>
1416 operator>=(
typename iterator_traits<_Bi_iter>::value_type
const&
__lhs,
1426 template<
typename _Bi_iter>
1428 operator<=(
typename iterator_traits<_Bi_iter>::value_type
const&
__lhs,
1439 template<
typename _Bi_iter>
1442 typename iterator_traits<_Bi_iter>::value_type
const&
__rhs)
1445 return __lhs.compare(string_type(1,
__rhs)) == 0;
1455 template<
typename _Bi_iter>
1458 typename iterator_traits<_Bi_iter>::value_type
const&
__rhs)
1467 template<
typename _Bi_iter>
1470 typename iterator_traits<_Bi_iter>::value_type
const&
__rhs)
1473 return __lhs.compare(string_type(1,
__rhs)) < 0;
1482 template<
typename _Bi_iter>
1485 typename iterator_traits<_Bi_iter>::value_type
const&
__rhs)
1494 template<
typename _Bi_iter>
1497 typename iterator_traits<_Bi_iter>::value_type
const&
__rhs)
1506 template<
typename _Bi_iter>
1509 typename iterator_traits<_Bi_iter>::value_type
const&
__rhs)
1520 template<
typename _Ch_type,
typename _Ch_traits,
typename _Bi_iter>
1522 basic_ostream<_Ch_type, _Ch_traits>&
1523 operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
1524 const sub_match<_Bi_iter>& __m)
1525 {
return __os << __m.str(); }
1551 template<
typename _Bi_iter,
1552 typename _Alloc = allocator<sub_match<_Bi_iter> > >
1554 :
private std::vector<sub_match<_Bi_iter>, _Alloc>
1585 typedef typename _Base_type::const_iterator const_iterator;
1586 typedef const_iterator iterator;
1587 typedef typename __iter_traits::difference_type difference_type;
1589 typedef _Alloc allocator_type;
1590 typedef typename __iter_traits::value_type char_type;
1645 bool ready()
const {
return !_Base_type::empty(); }
1663 {
return _Base_type::empty() ? 0 : _Base_type::size() - 3; }
1667 {
return _Base_type::max_size(); }
1676 {
return size() == 0; }
1695 {
return (*
this)[
__sub].length(); }
1739 __glibcxx_assert(
ready() );
1741 ? _Base_type::operator[](
__sub)
1742 : _M_unmatched_sub();
1756 __glibcxx_assert(
ready() );
1757 return !
empty() ? _M_prefix() : _M_unmatched_sub();
1771 __glibcxx_assert(
ready() );
1772 return !
empty() ? _M_suffix() : _M_unmatched_sub();
1780 {
return _Base_type::begin(); }
1787 {
return this->
begin(); }
1794 {
return _Base_type::end() - (
empty() ? 0 : 3); }
1801 {
return this->
end(); }
1818 template<
typename _Out_iter>
1827 template<
typename _Out_iter,
typename _St,
typename _Sa>
1839 template<
typename _St,
typename _Sa>
1876 {
return _Base_type::get_allocator(); }
1892 _Base_type::swap(
__that);
1898 template<
typename,
typename,
typename,
bool>
1901 template<
typename,
typename,
typename>
1904 template<
typename _Bp,
typename _Ap,
typename _Cp,
typename _Rp,
1905 __detail::_RegexExecutorPolicy,
bool>
1906 friend bool __detail::
1907#if _GLIBCXX_INLINE_VERSION
1915 _M_resize(
unsigned int __size)
1916 { _Base_type::resize(__size + 3); }
1919 _M_unmatched_sub()
const
1920 {
return _Base_type::operator[](_Base_type::size() - 3); }
1922 sub_match<_Bi_iter>&
1924 {
return _Base_type::operator[](_Base_type::size() - 3); }
1928 {
return _Base_type::operator[](_Base_type::size() - 2); }
1930 sub_match<_Bi_iter>&
1932 {
return _Base_type::operator[](_Base_type::size() - 2); }
1936 {
return _Base_type::operator[](_Base_type::size() - 1); }
1938 sub_match<_Bi_iter>&
1940 {
return _Base_type::operator[](_Base_type::size() - 1); }
1945 typedef match_results<const char*> cmatch;
1946 typedef match_results<string::const_iterator> smatch;
1947#ifdef _GLIBCXX_USE_WCHAR_T
1948 typedef match_results<const wchar_t*> wcmatch;
1949 typedef match_results<wstring::const_iterator> wsmatch;
1958 template<
typename _Bi_iter,
typename _Alloc>
1971 return __m1.prefix() ==
__m2.prefix()
1982 template<
typename _Bi_iter,
class _Alloc>
1996 template<
typename _Bi_iter,
typename _Alloc>
2002_GLIBCXX_END_NAMESPACE_CXX11
2025 template<
typename _Bi_iter,
typename _Alloc,
2026 typename _Ch_type,
typename _Rx_traits>
2036 __detail::_RegexExecutorPolicy::_S_auto,
true>
2037 (
__s, __e, __m,
__re, __flags);
2054 template<
typename _Bi_iter,
typename _Ch_type,
typename _Rx_traits>
2079 template<
typename _Ch_type,
typename _Alloc,
typename _Rx_traits>
2102 template<
typename _Ch_traits,
typename _Ch_alloc,
2103 typename _Alloc,
typename _Ch_type,
typename _Rx_traits>
2116 template<
typename _Ch_traits,
typename _Ch_alloc,
2117 typename _Alloc,
typename _Ch_type,
typename _Rx_traits>
2139 template<
typename _Ch_type,
class _Rx_traits>
2160 template<
typename _Ch_traits,
typename _Str_allocator,
2161 typename _Ch_type,
typename _Rx_traits>
2183 template<
typename _Bi_iter,
typename _Alloc,
2184 typename _Ch_type,
typename _Rx_traits>
2193 __detail::_RegexExecutorPolicy::_S_auto,
false>
2194 (
__s, __e, __m,
__re, __flags);
2208 template<
typename _Bi_iter,
typename _Ch_type,
typename _Rx_traits>
2231 template<
typename _Ch_type,
class _Alloc,
class _Rx_traits>
2250 template<
typename _Ch_type,
typename _Rx_traits>
2268 template<
typename _Ch_traits,
typename _String_allocator,
2269 typename _Ch_type,
typename _Rx_traits>
2290 template<
typename _Ch_traits,
typename _Ch_alloc,
2291 typename _Alloc,
typename _Ch_type,
2292 typename _Rx_traits>
2305 template<
typename _Ch_traits,
typename _Ch_alloc,
2306 typename _Alloc,
typename _Ch_type,
2307 typename _Rx_traits>
2330 template<
typename _Out_iter,
typename _Bi_iter,
2332 typename _St,
typename _Sa>
2356 template<
typename _Out_iter,
typename _Bi_iter,
2357 typename _Rx_traits,
typename _Ch_type>
2359 regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last,
2360 const basic_regex<_Ch_type, _Rx_traits>& __e,
2361 const _Ch_type* __fmt,
2376 template<
typename _Rx_traits,
typename _Ch_type,
2377 typename _St,
typename _Sa,
typename _Fst,
typename _Fsa>
2378 inline basic_string<_Ch_type, _St, _Sa>
2402 template<
typename _Rx_traits,
typename _Ch_type,
2403 typename _St,
typename _Sa>
2404 inline basic_string<_Ch_type, _St, _Sa>
2428 template<
typename _Rx_traits,
typename _Ch_type,
2429 typename _St,
typename _Sa>
2430 inline basic_string<_Ch_type>
2440 __e,
__fmt, __flags);
2455 template<
typename _Rx_traits,
typename _Ch_type>
2456 inline basic_string<_Ch_type>
2466 __e,
__fmt, __flags);
2472_GLIBCXX_BEGIN_NAMESPACE_CXX11
2479 template<
typename _Bi_iter,
2480 typename _Ch_type =
typename iterator_traits<_Bi_iter>::value_type,
2481 typename _Rx_traits = regex_traits<_Ch_type> >
2488 typedef const value_type* pointer;
2489 typedef const value_type& reference;
2510 : _M_begin(__a), _M_end(__b), _M_pregex(&
__re), _M_flags(__m), _M_match()
2512 if (!
regex_search(_M_begin, _M_end, _M_match, *_M_pregex, _M_flags))
2543 {
return !(*
this ==
__rhs); }
2550 {
return _M_match; }
2557 {
return &_M_match; }
2579 const regex_type* _M_pregex;
2586#ifdef _GLIBCXX_USE_WCHAR_T
2599 template<
typename _Bi_iter,
2600 typename _Ch_type =
typename iterator_traits<_Bi_iter>::value_type,
2621 : _M_position(), _M_subs(), _M_suffix(), _M_n(0), _M_result(
nullptr),
2646 : _M_position(__a, __b,
__re, __m), _M_subs(1,
__submatch), _M_n(0)
2647 { _M_init(__a, __b); }
2664 { _M_init(__a, __b); }
2681 { _M_init(__a, __b); }
2692 template<std::
size_t _Nm>
2698 : _M_position(__a, __b,
__re, __m),
2700 { _M_init(__a, __b); }
2715 template <std::
size_t _Nm>
2726 : _M_position(
__rhs._M_position), _M_subs(
__rhs._M_subs),
2727 _M_suffix(
__rhs._M_suffix), _M_n(
__rhs._M_n), _M_has_m1(
__rhs._M_has_m1)
2728 { _M_normalize_result(); }
2748 {
return !(*
this ==
__rhs); }
2755 {
return *_M_result; }
2762 {
return _M_result; }
2785 _M_init(_Bi_iter __a, _Bi_iter __b);
2788 _M_current_match()
const
2790 if (_M_subs[_M_n] == -1)
2791 return (*_M_position).prefix();
2793 return (*_M_position)[_M_subs[_M_n]];
2797 _M_end_of_seq()
const
2798 {
return _M_result ==
nullptr; }
2802 _M_normalize_result()
2804 if (_M_position != _Position())
2805 _M_result = &_M_current_match();
2807 _M_result = &_M_suffix;
2809 _M_result =
nullptr;
2812 _Position _M_position;
2814 value_type _M_suffix;
2816 const value_type* _M_result;
2828#ifdef _GLIBCXX_USE_WCHAR_T
2838_GLIBCXX_END_NAMESPACE_CXX11
2839_GLIBCXX_END_NAMESPACE_VERSION
char_type translate(char_type __c) const
Performs the identity translation.
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...
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.
sub_match< wstring::const_iterator > wssub_match
Regex submatch over a standard wide string.
sub_match< string::const_iterator > ssub_match
Standard regex submatch over a standard string.
basic_regex & operator=(const basic_regex &__rhs)
Assigns one regular expression to another.
bool operator==(const regex_iterator &__rhs) const
Tests the equivalence of two regex iterators.
bool empty() const
Indicates if the match_results contains no results.
friend bool __detail::__regex_algo_impl(_Bp, _Bp, match_results< _Bp, _Ap > &, const basic_regex< _Cp, _Rp > &, regex_constants::match_flag_type)
constexpr syntax_option_type collate
regex_iterator()
Provides a singular iterator, useful for indicating one-past-the-end of a range.
difference_type position(size_type __sub=0) const
Gets the offset of the beginning of the indicated 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.
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.
basic_regex & assign(_InputIterator __first, _InputIterator __last, flag_type __flags=ECMAScript)
Assigns a new regular expression to a regex object.
regex_token_iterator(const regex_token_iterator &__rhs)
Copy constructs a regex_token_iterator.
static constexpr flag_type egrep
size_type size() const
Gets the number of matches and submatches.
const_iterator end() const
Gets an iterator to one-past-the-end of the collection.
const_iterator begin() const
Gets an iterator to the start of the sub_match collection.
regex_iterator< wstring::const_iterator > wsregex_iterator
Token iterator for C-style NULL-terminated strings.
constexpr syntax_option_type ECMAScript
regex_token_iterator< wstring::const_iterator > wsregex_token_iterator
Token iterator for standard wide-character strings.
locale_type imbue(locale_type __loc)
Imbues the regular expression object with the given locale.
_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
constexpr syntax_option_type egrep
const_iterator cbegin() const
Gets an iterator to the start of the sub_match collection.
difference_type length(size_type __sub=0) const
Gets the length of the indicated submatch.
regex_traits()
Constructs a default traits object.
const_reference prefix() const
Gets a sub_match representing the match prefix.
syntax_option_type
This is a bitmask type indicating how to interpret the regex.
basic_regex(const basic_regex &__rhs)=default
Copy-constructs a basic regular expression.
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)
int value(_Ch_type __ch, int __radix) const
Converts a digit to an int.
regex_token_iterator< const wchar_t * > wcregex_token_iterator
Token iterator for C-style NULL-terminated wide strings.
basic_regex & assign(initializer_list< _Ch_type > __l, flag_type __flags=ECMAScript)
Assigns a new regular expression to a regex object.
regex_iterator operator++(int)
Postincrements a regex_iterator.
void swap(basic_regex &__rhs)
Swaps the contents of two regular expression objects.
basic_string< char_type, _St, _Sa > format(const basic_string< char_type, _St, _Sa > &__fmt, match_flag_type __flags=regex_constants::format_default) const
basic_regex & assign(basic_regex &&__rhs) noexcept
The move-assignment operator.
const_reference operator[](size_type __sub) const
Gets a sub_match reference for the match or submatch.
static constexpr flag_type extended
match_results(const _Alloc &__a=_Alloc())
Constructs a default match_results container.
unsigned int mark_count() const
Gets the number of marked subexpressions within the regular expression.
bool operator!=(const regex_token_iterator &__rhs) const
Compares a regex_token_iterator to another for inequality.
regex_iterator(_Bi_iter __a, _Bi_iter __b, const regex_type &__re, regex_constants::match_flag_type __m=regex_constants::match_default)
regex_token_iterator operator++(int)
Postincrements a regex_token_iterator.
const value_type & operator*() const
Dereferences a regex_iterator.
const_iterator cend() const
Gets an iterator to one-past-the-end of the collection.
const value_type * operator->() const
Selects a regex_token_iterator member.
_Out_iter format(_Out_iter __out, const basic_string< char_type, _St, _Sa > &__fmt, match_flag_type __flags=regex_constants::format_default) const
match_results & operator=(const match_results &__rhs)=default
Assigns rhs to *this.
regex_token_iterator & operator=(const regex_token_iterator &__rhs)
Assigns a regex_token_iterator to another.
void swap(match_results &__that)
Swaps the contents of two match_results.
constexpr match_flag_type match_default
regex_iterator< string::const_iterator > sregex_iterator
Token iterator for C-style NULL-terminated strings.
regex_token_iterator & operator++()
Increments a regex_token_iterator.
static constexpr flag_type awk
basic_regex & assign(const basic_regex &__rhs)
the real assignment operator.
static constexpr flag_type ECMAScript
constexpr syntax_option_type awk
string_type str(size_type __sub=0) const
Gets the match or submatch converted to a string type.
regex_iterator< const wchar_t * > wcregex_iterator
Token iterator for C-style NULL-terminated strings.
~match_results()
Destroys a match_results object.
regex_token_iterator()
Default constructs a regex_token_iterator.
basic_regex< char > regex
Standard regular expressions.
constexpr syntax_option_type extended
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...
_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...
int compare(const value_type *__s) const
Compares this sub_match to a C-style string.
bool ready() const
Indicates if the match_results is ready.
static constexpr flag_type nosubs
regex_iterator & operator=(const regex_iterator &__rhs)=default
Assigns one regex_iterator to another.
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.
constexpr syntax_option_type basic
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.
allocator_type get_allocator() const
Gets a copy of the allocator.
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...
char_type translate_nocase(char_type __c) const
Translates a character into a case-insensitive equivalent.
match_flag_type
This is a bitmask type indicating regex matching rules.
const value_type * operator->() const
Selects a regex_iterator member.
const_reference suffix() const
Gets a sub_match representing the match suffix.
locale_type getloc() const
Gets the locale currently imbued in the regular expression object.
static constexpr flag_type basic
static constexpr flag_type grep
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...
size_type max_size() const
Gets the number of matches and submatches.
match_results & operator=(match_results &&__rhs)=default
Move-assigns rhs to *this.
static constexpr flag_type icase
constexpr syntax_option_type icase
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 regex_iterator &__rhs) const
Tests the inequivalence of two regex iterators.
difference_type length() const
string_type lookup_collatename(_Fwd_iter __first, _Fwd_iter __last) const
Gets a collation element by name.
flag_type flags() const
Gets the flags used to construct the regular expression or in the last call to assign().
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.
const value_type & operator*() const
Dereferences a regex_token_iterator.
regex_iterator< const char * > cregex_iterator
Token iterator for C-style NULL-terminated strings.
locale_type getloc() const
Gets a copy of the current locale in use by the regex_traits object.
constexpr syntax_option_type optimize
string_type format(const char_type *__fmt, match_flag_type __flags=regex_constants::format_default) const
string_type str() const
Gets the matching sequence as a string.
constexpr match_flag_type format_default
regex_iterator(const regex_iterator &__rhs)=default
constexpr syntax_option_type nosubs
match_results(const match_results &__rhs)=default
Copy constructs a match_results.
bool isctype(_Ch_type __c, char_class_type __f) const
Determines if c is a member of an identified class.
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< wchar_t > wregex
Standard wide-character regular expressions.
locale_type imbue(locale_type __loc)
Imbues the regex_traits object with a copy of a new locale.
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.
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.
basic_regex & operator=(const basic_string< _Ch_type, _Ch_traits, _Alloc > &__s)
Replaces a regular expression with a new one constructed from a string.
regex_iterator & operator++()
Increments a regex_iterator.
int compare(const sub_match &__s) const
Compares this and another matched sequence.
string_type transform(_Fwd_iter __first, _Fwd_iter __last) const
Gets a sort key for a character sequence.
int compare(const string_type &__s) const
Compares this sub_match to a string.
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)
match_results(match_results &&__rhs) noexcept=default
Move constructs a match_results.
~basic_regex()
Destroys a basic regular expression.
basic_regex & assign(const _Ch_type *__p, std::size_t __len, flag_type __flags)
Assigns a new regular expression to a regex object from a C-style string containing a regular express...
static constexpr flag_type optimize
constexpr syntax_option_type grep
back_insert_iterator< _Container > back_inserter(_Container &__x)
ISO C++ entities toplevel namespace is std.
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initializer_list.
bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initializer_list.
iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
typename _Size< _Alloc, difference_type >::type size_type
The allocator's size type.
Managing sequences of characters and character-like objects.
int compare(const basic_string &__str) const
Compare to a string.
Basis for explicit traits specializations.
Container class for localization functionality.
Facet for localized string comparison.
The results of a match or search operation.
Takes a regex and an input string and does the matching.
Describes aspects of a regular expression.
Forward iterators support a superset of input iterator operations.
Struct holding two objects of arbitrary type.
_BiIter first
second_type is the second bound type
_BiIter second
first is a copy of the first object
A standard container which offers fixed time access to individual elements in any order.