31 namespace std _GLIBCXX_VISIBILITY(default)
33 _GLIBCXX_BEGIN_NAMESPACE_VERSION
52 template<
typename _Ch_type>
56 typedef _Ch_type char_type;
59 typedef std::ctype_base::mask char_class_type;
80 {
return string_type::traits_type::length(__p); }
107 return use_facet<ctype<char_type> >(_M_locale).
tolower(__c);
130 template<
typename _Fwd_iter>
156 template<
typename _Fwd_iter>
174 template<
typename _Fwd_iter>
217 template<
typename _Fwd_iter>
220 bool __icase =
false)
const
236 isctype(_Ch_type __c, char_class_type __f)
const;
249 value(_Ch_type __ch,
int __radix)
const;
265 std::swap(_M_locale, __loc);
275 {
return _M_locale; }
278 locale_type _M_locale;
281 template<
typename _Ch_type>
284 isctype(_Ch_type __c, char_class_type __f)
const
291 if (__ctype.
is(__f, __c))
295 if (__c == __ctype.
widen(
'_'))
297 const char __wb[] =
"w";
298 char_class_type __wt = this->lookup_classname(__wb,
299 __wb +
sizeof(__wb));
305 if (__ctype.
is(std::ctype_base::space, __c))
307 const char __bb[] =
"blank";
308 char_class_type __bt = this->lookup_classname(__bb,
309 __bb +
sizeof(__bb));
317 template<
typename _Ch_type>
320 value(_Ch_type __ch,
int __radix)
const
326 else if (__radix == 16)
329 return __is.
fail() ? -1 : __v;
340 template<
typename _Ch_type,
typename _Rx_traits = regex_traits<_Ch_type> >
345 typedef _Ch_type value_type;
346 typedef _Rx_traits traits_type;
347 typedef typename traits_type::string_type string_type;
349 typedef typename traits_type::locale_type locale_type;
384 : _M_flags(regex_constants::ECMAScript),
385 _M_automaton(__regex::__compile<const _Ch_type*, _Rx_traits>(0, 0,
386 _M_traits, _M_flags))
404 _M_automaton(__regex::__compile(__p, __p + _Rx_traits::length(__p),
405 _M_traits, _M_flags))
419 basic_regex(
const _Ch_type* __p, std::size_t __len, flag_type __f)
421 _M_automaton(__regex::__compile(__p, __p + __len, _M_traits, _M_flags))
430 : _M_flags(__rhs._M_flags), _M_traits(__rhs._M_traits),
431 _M_automaton(__rhs._M_automaton)
440 : _M_flags(__rhs._M_flags), _M_traits(__rhs._M_traits),
441 _M_automaton(std::move(__rhs._M_automaton))
453 template<
typename _Ch_traits,
typename _Ch_alloc>
459 _M_automaton(__regex::__compile(__s.
begin(), __s.
end(),
460 _M_traits, _M_flags))
476 template<
typename _InputIterator>
480 _M_automaton(__regex::__compile(__first, __last, _M_traits, _M_flags))
494 _M_automaton(__regex::__compile(__l.
begin(), __l.
end(),
495 _M_traits, _M_flags))
509 {
return this->
assign(__rhs); }
516 {
return this->
assign(std::move(__rhs)); }
535 template<
typename _Ch_typeraits,
typename _Allocator>
583 {
return this->
assign(string_type(__p), __flags); }
599 assign(
const _Ch_type* __p, std::size_t __len, flag_type __flags)
600 {
return this->
assign(string_type(__p, __len), __flags); }
613 template<
typename _Ch_typeraits,
typename _Allocator>
636 template<
typename _InputIterator>
638 assign(_InputIterator __first, _InputIterator __last,
640 {
return this->
assign(string_type(__first, __last), __flags); }
655 {
return this->
assign(__l.begin(), __l.end(), __f); }
664 {
return _M_automaton->_M_sub_count() - 1; }
682 {
return _M_traits.imbue(__loc); }
690 {
return _M_traits.getloc(); }
701 std::swap(_M_flags, __rhs._M_flags);
702 std::swap(_M_traits, __rhs._M_traits);
703 std::swap(_M_automaton, __rhs._M_automaton);
706 #ifdef _GLIBCXX_DEBUG
709 { _M_automaton->_M_dot(__ostr); }
712 const __regex::_AutomatonPtr&
713 _M_get_automaton()
const
714 {
return _M_automaton; }
718 _Rx_traits _M_traits;
719 __regex::_AutomatonPtr _M_automaton;
724 #ifdef _GLIBCXX_USE_WCHAR_T
736 template<
typename _Ch_type,
typename _Rx_traits>
740 { __lhs.
swap(__rhs); }
756 template<
typename _BiIter>
760 typedef typename iterator_traits<_BiIter>::value_type value_type;
761 typedef typename iterator_traits<_BiIter>::difference_type
763 typedef _BiIter iterator;
853 #ifdef _GLIBCXX_USE_WCHAR_T
868 template<
typename _BiIter>
872 {
return __lhs.
compare(__rhs) == 0; }
880 template<
typename _BiIter>
884 {
return __lhs.
compare(__rhs) != 0; }
892 template<
typename _BiIter>
894 operator<(const sub_match<_BiIter>& __lhs,
896 {
return __lhs.
compare(__rhs) < 0; }
904 template<
typename _BiIter>
906 operator<=(const sub_match<_BiIter>& __lhs,
908 {
return __lhs.
compare(__rhs) <= 0; }
916 template<
typename _BiIter>
920 {
return __lhs.
compare(__rhs) >= 0; }
928 template<
typename _BiIter>
932 {
return __lhs.
compare(__rhs) > 0; }
941 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
944 typename iterator_traits<_Bi_iter>::value_type,
945 _Ch_traits, _Ch_alloc>& __lhs,
947 {
return __rhs.
compare(__lhs.c_str()) == 0; }
956 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
959 typename iterator_traits<_Bi_iter>::value_type,
961 {
return !(__lhs == __rhs); }
969 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
972 typename iterator_traits<_Bi_iter>::value_type,
974 {
return __rhs.
compare(__lhs.c_str()) > 0; }
982 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
985 typename iterator_traits<_Bi_iter>::value_type,
987 {
return __rhs < __lhs; }
995 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
998 typename iterator_traits<_Bi_iter>::value_type,
1000 {
return !(__lhs < __rhs); }
1008 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1011 typename iterator_traits<_Bi_iter>::value_type,
1013 {
return !(__rhs < __lhs); }
1022 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1026 typename iterator_traits<_Bi_iter>::value_type,
1027 _Ch_traits, _Ch_alloc>& __rhs)
1028 {
return __lhs.
compare(__rhs.c_str()) == 0; }
1037 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1041 typename iterator_traits<_Bi_iter>::value_type,
1042 _Ch_traits, _Ch_alloc>& __rhs)
1043 {
return !(__lhs == __rhs); }
1051 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1053 operator<(const sub_match<_Bi_iter>& __lhs,
1055 typename iterator_traits<_Bi_iter>::value_type,
1056 _Ch_traits, _Ch_alloc>& __rhs)
1057 {
return __lhs.
compare(__rhs.c_str()) < 0; }
1065 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1069 typename iterator_traits<_Bi_iter>::value_type,
1070 _Ch_traits, _Ch_alloc>& __rhs)
1071 {
return __rhs < __lhs; }
1079 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1083 typename iterator_traits<_Bi_iter>::value_type,
1084 _Ch_traits, _Ch_alloc>& __rhs)
1085 {
return !(__lhs < __rhs); }
1093 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1095 operator<=(const sub_match<_Bi_iter>& __lhs,
1097 typename iterator_traits<_Bi_iter>::value_type,
1098 _Ch_traits, _Ch_alloc>& __rhs)
1099 {
return !(__rhs < __lhs); }
1108 template<
typename _Bi_iter>
1110 operator==(
typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1112 {
return __rhs.
compare(__lhs) == 0; }
1121 template<
typename _Bi_iter>
1123 operator!=(
typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1125 {
return !(__lhs == __rhs); }
1133 template<
typename _Bi_iter>
1135 operator<(typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1137 {
return __rhs.
compare(__lhs) > 0; }
1145 template<
typename _Bi_iter>
1147 operator>(
typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1149 {
return __rhs < __lhs; }
1157 template<
typename _Bi_iter>
1159 operator>=(
typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1161 {
return !(__lhs < __rhs); }
1169 template<
typename _Bi_iter>
1171 operator<=(typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1173 {
return !(__rhs < __lhs); }
1182 template<
typename _Bi_iter>
1185 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1186 {
return __lhs.
compare(__rhs) == 0; }
1195 template<
typename _Bi_iter>
1198 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1199 {
return !(__lhs == __rhs); }
1207 template<
typename _Bi_iter>
1209 operator<(const sub_match<_Bi_iter>& __lhs,
1210 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1211 {
return __lhs.compare(__rhs) < 0; }
1219 template<
typename _Bi_iter>
1222 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1223 {
return __rhs < __lhs; }
1231 template<
typename _Bi_iter>
1234 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1235 {
return !(__lhs < __rhs); }
1243 template<
typename _Bi_iter>
1245 operator<=(const sub_match<_Bi_iter>& __lhs,
1246 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1247 {
return !(__rhs < __lhs); }
1256 template<
typename _Bi_iter>
1258 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,
1276 {
return !(__lhs == __rhs); }
1284 template<
typename _Bi_iter>
1286 operator<(typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1299 template<
typename _Bi_iter>
1301 operator>(
typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1303 {
return __rhs < __lhs; }
1311 template<
typename _Bi_iter>
1313 operator>=(
typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1315 {
return !(__lhs < __rhs); }
1323 template<
typename _Bi_iter>
1325 operator<=(typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1327 {
return !(__rhs < __lhs); }
1336 template<
typename _Bi_iter>
1339 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1352 template<
typename _Bi_iter>
1355 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1356 {
return !(__lhs == __rhs); }
1364 template<
typename _Bi_iter>
1366 operator<(const sub_match<_Bi_iter>& __lhs,
1367 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1379 template<
typename _Bi_iter>
1382 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1383 {
return __rhs < __lhs; }
1391 template<
typename _Bi_iter>
1394 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1395 {
return !(__lhs < __rhs); }
1403 template<
typename _Bi_iter>
1405 operator<=(const sub_match<_Bi_iter>& __lhs,
1406 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1407 {
return !(__rhs < __lhs); }
1417 template<
typename _Ch_type,
typename _Ch_traits,
typename _Bi_iter>
1419 basic_ostream<_Ch_type, _Ch_traits>&
1420 operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
1422 {
return __os << __m.
str(); }
1429 template<
typename _Bi_iter>
1430 inline const sub_match<_Bi_iter>&
1433 static const sub_match<_Bi_iter> __unmatched = sub_match<_Bi_iter>();
1459 template<
typename _Bi_iter,
1460 typename _Allocator = allocator<sub_match<_Bi_iter> > >
1462 :
private std::vector<sub_match<_Bi_iter>, _Allocator>
1486 typedef typename _Base_type::const_iterator const_iterator;
1487 typedef const_iterator iterator;
1488 typedef typename std::iterator_traits<_Bi_iter>::difference_type
1491 typedef typename _Allocator::size_type size_type;
1492 typedef _Allocator allocator_type;
1493 typedef typename std::iterator_traits<_Bi_iter>::value_type
1581 return (__size && _Base_type::operator[](0).matched) ? __size - 2 : 0;
1595 {
return size() == 0; }
1614 {
return (*
this)[__sub].length(); }
1633 (*
this)[__sub].first) : -1;
1645 str(size_type __sub = 0)
const
1646 {
return (*
this)[__sub].str(); }
1662 _GLIBCXX_DEBUG_ASSERT(
ready() );
1663 return __sub <
size()
1665 : __unmatched_sub<_Bi_iter>();
1679 _GLIBCXX_DEBUG_ASSERT(
ready() );
1682 : __unmatched_sub<_Bi_iter>();
1696 _GLIBCXX_DEBUG_ASSERT(
ready() );
1699 : __unmatched_sub<_Bi_iter>();
1746 template<
typename _Out_iter>
1748 format(_Out_iter __out,
const char_type* __fmt_first,
1749 const char_type* __fmt_last,
1757 template<
typename _Out_iter,
typename _St,
typename _Sa>
1770 template<
typename _Out_iter,
typename _St,
typename _Sa>
1808 {
return _Base_type::get_allocator(); }
1826 friend class __regex::_SpecializedResults<_Bi_iter, _Allocator>;
1829 typedef match_results<const char*> cmatch;
1830 typedef match_results<string::const_iterator> smatch;
1831 #ifdef _GLIBCXX_USE_WCHAR_T
1832 typedef match_results<const wchar_t*> wcmatch;
1833 typedef match_results<wstring::const_iterator> wsmatch;
1842 template<
typename _Bi_iter,
typename _Allocator>
1866 template<
typename _Bi_iter,
class _Allocator>
1870 {
return !(__m1 == __m2); }
1880 template<
typename _Bi_iter,
typename _Allocator>
1884 { __lhs.
swap(__rhs); }
1909 template<
typename _Bi_iter,
typename _Allocator,
1910 typename _Ch_type,
typename _Rx_traits>
1920 __regex::_Automaton::_SizeT __sz = __a->_M_sub_count();
1921 __regex::_SpecializedCursor<_Bi_iter> __cs(__s, __e);
1922 __regex::_SpecializedResults<_Bi_iter, _Allocator> __r(__sz, __cs, __m);
1923 __regex::_Grep_matcher __matcher(__cs, __r, __a, __flags);
1924 return __m[0].matched;
1941 template<
typename _Bi_iter,
typename _Ch_type,
typename _Rx_traits>
1949 return regex_match(__first, __last, __what, __re, __flags);
1966 template<
typename _Ch_type,
typename _Allocator,
typename _Rx_traits>
1973 {
return regex_match(__s, __s + _Rx_traits::length(__s), __m, __re, __f); }
1989 template<
typename _Ch_traits,
typename _Ch_alloc,
1990 typename _Allocator,
typename _Ch_type,
typename _Rx_traits>
1994 _Ch_traits, _Ch_alloc>::const_iterator, _Allocator>& __m,
2013 template<
typename _Ch_type,
class _Rx_traits>
2019 {
return regex_match(__s, __s + _Rx_traits::length(__s), __re, __f); }
2034 template<
typename _Ch_traits,
typename _Str_allocator,
2035 typename _Ch_type,
typename _Rx_traits>
2059 template<
typename _Bi_iter,
typename _Allocator,
2060 typename _Ch_type,
typename _Rx_traits>
2081 template<
typename _Bi_iter,
typename _Ch_type,
typename _Rx_traits>
2089 return regex_search(__first, __last, __what, __re, __flags);
2105 template<
typename _Ch_type,
class _Allocator,
class _Rx_traits>
2112 {
return regex_search(__s, __s + _Rx_traits::length(__s), __m, __e, __f); }
2125 template<
typename _Ch_type,
typename _Rx_traits>
2131 {
return regex_search(__s, __s + _Rx_traits::length(__s), __e, __f); }
2144 template<
typename _Ch_traits,
typename _String_allocator,
2145 typename _Ch_type,
typename _Rx_traits>
2148 _String_allocator>& __s,
2152 {
return regex_search(__s.begin(), __s.end(), __e, __flags); }
2166 template<
typename _Ch_traits,
typename _Ch_alloc,
2167 typename _Allocator,
typename _Ch_type,
2168 typename _Rx_traits>
2172 _Ch_traits, _Ch_alloc>::const_iterator, _Allocator>& __m,
2193 template<
typename _Out_iter,
typename _Bi_iter,
2194 typename _Rx_traits,
typename _Ch_type>
2214 template<
typename _Rx_traits,
typename _Ch_type>
2215 inline basic_string<_Ch_type>
2224 __s.
begin(), __s.
end(), __e, __fmt, __flags);
2235 template<
typename _Bi_iter,
2236 typename _Ch_type =
typename iterator_traits<_Bi_iter>::value_type,
2237 typename _Rx_traits = regex_traits<_Ch_type> >
2243 typedef std::ptrdiff_t difference_type;
2337 #ifdef _GLIBCXX_USE_WCHAR_T
2350 template<
typename _Bi_iter,
2351 typename _Ch_type =
typename iterator_traits<_Bi_iter>::value_type,
2358 typedef std::ptrdiff_t difference_type;
2429 template<std::
size_t _Nm>
2432 const int (&__submatches)[_Nm],
2448 regex_token_iterator&
2449 operator=(
const regex_token_iterator& __rhs);
2456 operator==(
const regex_token_iterator& __rhs);
2463 operator!=(
const regex_token_iterator& __rhs);
2483 regex_token_iterator&
2490 regex_token_iterator
2496 position_iterator __position;
2507 #ifdef _GLIBCXX_USE_WCHAR_T
2515 _GLIBCXX_END_NAMESPACE_VERSION
static constexpr syntax_option_type ECMAScript
void swap(match_results< _Bi_iter, _Allocator > &__lhs, match_results< _Bi_iter, _Allocator > &__rhs)
Swaps two match results.
bool operator!=(const regex_iterator &__rhs)
bool fail() const
Fast error checking.
void swap(basic_regex &__rhs)
Swaps the contents of two regular expression objects.
basic_regex & assign(basic_regex &&__rhs) noexcept
The move-assignment operator.
regex_token_iterator & operator=(const regex_token_iterator &__rhs)
Assigns a regex_token_iterator to another.
Basis for explicit traits specializations.
basic_regex & assign(const _Ch_type *__p, flag_type __flags=regex_constants::ECMAScript)
Assigns a new regular expression to a regex object from a C-style null-terminated string containing a...
basic_regex< char > regex
Standard regular expressions.
const_iterator cbegin() const
Struct holding two objects of arbitrary type.
Facet for localized string comparison.
bool operator==(const regex_iterator &__rhs)
_BiIter first
second_type is the second bound type
regex_iterator & operator++()
constexpr const _Tp * begin(initializer_list< _Tp > __ils)
Return an iterator pointing to the first element of the initilizer_list.
int compare(const value_type *__s) const
Compares this sub_match to a C-style string.
basic_regex & assign(_InputIterator __first, _InputIterator __last, flag_type __flags=regex_constants::ECMAScript)
Assigns a new regular expression to a regex object.
char_type translate(char_type __c) const
Performs the identity translation.
const_iterator cend() const
Gets an iterator to one-past-the-end of the collection.
const_reference operator[](size_type __sub) const
Gets a sub_match reference for the match or submatch.
static constexpr syntax_option_type icase
const_iterator begin() const
Gets an iterator to the start of the sub_match collection.
regex_iterator & operator=(const regex_iterator &__rhs)
regex_traits()
Constructs a default traits object.
int compare(const basic_string &__str) const
Compare to a string.
regex_token_iterator< const char * > cregex_token_iterator
Token iterator for C-style NULL-terminated strings.
_Out_iter format(_Out_iter __out, const char_type *__fmt_first, const char_type *__fmt_last, regex_constants::match_flag_type __flags=regex_constants::format_default) const
back_insert_iterator< _Container > back_inserter(_Container &__x)
basic_regex & assign(const basic_regex &__rhs)
the real assignment operator.
basic_regex(const basic_regex &&__rhs) noexcept
Move-constructs a basic regular expression.
const_iterator end() const
Gets an iterator to one-past-the-end of the collection.
static constexpr syntax_option_type collate
size_type size() const
Gets the number of matches and submatches.
basic_regex(const std::basic_string< _Ch_type, _Ch_traits, _Ch_alloc > &__s, flag_type __f=regex_constants::ECMAScript)
Constructs a basic regular expression from the string s interpreted according to the flags in f...
basic_regex & operator=(const basic_regex &__rhs)
Assigns one regular expression to another.
locale_type imbue(locale_type __loc)
Imbues the regular expression object with the given locale.
const _CharT * data() const
Return const pointer to contents.
regex_token_iterator< const wchar_t * > wcregex_token_iterator
Token iterator for C-style NULL-terminated wide strings.
regex_iterator()
Provides a singular iterator, useful for indicating one-past-the-end of a range.
locale_type imbue(locale_type __loc)
Imbues the regex_traits object with a copy of a new locale.
unsigned int mark_count() const
Gets the number of marked subexpressions within the regular expression.
void swap(match_results &__that)
Swaps the contents of two match_results.
Primary class template ctype facet.This template class defines classification and conversion function...
bool regex_search(_Bi_iter __first, _Bi_iter __last, match_results< _Bi_iter, _Allocator > &__m, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __flags=regex_constants::match_default)
const value_type * operator->()
~match_results()
Destroys a match_results object.
ios_base & oct(ios_base &__base)
Calls base.setf(ios_base::oct, ios_base::basefield).
bool isctype(_Ch_type __c, char_class_type __f) const
Determines if c is a member of an identified class.
ios_base & hex(ios_base &__base)
Calls base.setf(ios_base::hex, ios_base::basefield).
bool empty() const
Indicates if the match_results contains no results.
bool operator==(const regex_token_iterator &__rhs)
Compares a regex_token_iterator to another for equality.
char_type widen(char __c) const
Widen char to char_type.
match_results(const match_results &__rhs)
Copy constructs a match_results.
Forward iterators support a superset of input iterator operations.
string_type format(const char_type *__fmt, regex_constants::match_flag_type __flags=regex_constants::format_default) const
static constexpr syntax_option_type nosubs
bool regex_match(_Bi_iter __s, _Bi_iter __e, match_results< _Bi_iter, _Allocator > &__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...
basic_regex & operator=(const basic_string< _Ch_type, _Ch_typeraits, _Allocator > &__s)
Replaces a regular expression with a new one constructed from a string.
int value(_Ch_type __ch, int __radix) const
Converts a digit to an int.
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...
bool ready() const
Indicates if the match_results is ready.
static constexpr match_flag_type match_default
basic_regex(initializer_list< _Ch_type > __l, flag_type __f=regex_constants::ECMAScript)
Constructs a basic regular expression from an initializer list.
sub_match< const char * > csub_match
Standard regex submatch over a C-style null-terminated string.
sub_match< string::const_iterator > ssub_match
Standard regex submatch over a standard string.
bool operator!=(const match_results< _Bi_iter, _Allocator > &__m1, const match_results< _Bi_iter, _Allocator > &__m2)
Compares two match_results for inequality.
Container class for localization functionality.The locale class is first a class wrapper for C librar...
std::bitset< _S_match_flag_last > match_flag_type
This is a bitmask type indicating regex matching rules.
bool equal(_II1 __first1, _II1 __last1, _II2 __first2)
Tests a range for element-wise equality.
match_results(const _Allocator &__a=_Allocator())
Constructs a default match_results container.
basic_regex & assign(const basic_string< _Ch_type, _Ch_typeraits, _Allocator > &__s, flag_type __f=regex_constants::ECMAScript)
Assigns a new regular expression to a regex object from a string containing a regular expression patt...
string_type transform(_Fwd_iter __first, _Fwd_iter __last) const
Gets a sort key for a character sequence.
Describes aspects of a regular expression.
sub_match< const wchar_t * > wcsub_match
Regex submatch over a C-style null-terminated wide string.
basic_regex & operator=(basic_regex &&__rhs) noexcept
Move-assigns one regular expression to another.
size_type size() const
Returns the number of characters in the string, not including any null-termination.
Managing sequences of characters and character-like objects.
regex_token_iterator< wstring::const_iterator > wsregex_token_iterator
Token iterator for standard wide-character strings.
basic_regex(const _Ch_type *__p, std::size_t __len, flag_type __f)
Constructs a basic regular expression from the sequence [p, p + len) interpreted according to the fla...
basic_string< char_type, _St, _Sa > format(const basic_string< char_type, _St, _Sa > &__fmt, regex_constants::match_flag_type __flags=regex_constants::format_default) const
const value_type * operator->()
Selects a regex_token_iterator member.
Controlling input for std::string.This class supports reading from objects of type std::basic_string...
basic_regex & assign(initializer_list< _Ch_type > __l, flag_type __f=regex_constants::ECMAScript)
Assigns a new regular expression to a regex object.
size_type max_size() const
_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 > &__fmt, regex_constants::match_flag_type __flags=regex_constants::match_default)
_CharT tolower(_CharT __c, const locale &__loc)
Convenience interface to ctype.tolower(__c).
void swap(vector &__x)
Swaps data with another vector.
static constexpr syntax_option_type egrep
~basic_regex()
Destroys a basic regular expression.
_Out_iter format(_Out_iter __out, const basic_string< char_type, _St, _Sa > &__fmt, regex_constants::match_flag_type __flags=regex_constants::format_default) const
The results of a match or search operation.
constexpr const _Tp * end(initializer_list< _Tp > __ils)
Return an iterator pointing to one past the last element of the initilizer_list.
match_results & operator=(const match_results &__rhs)
Assigns rhs to *this.
locale_type getloc() const
Gets a copy of the current locale in use by the regex_traits object.
iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
A standard container which offers fixed time access to individual elements in any order...
flag_type flags() const
Gets the flags used to construct the regular expression or in the last call to assign().
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.
const value_type & operator*()
match_results & operator=(match_results &&__rhs)
Move-assigns rhs to *this.
allocator_type get_allocator() const
Gets a copy of the allocator.
size_type max_size() const
Gets the number of matches and submatches.
string_type transform_primary(_Fwd_iter __first, _Fwd_iter __last) const
Gets a sort key for a character sequence, independant of case.
static constexpr syntax_option_type basic
bool is(mask __m, char_type __c) const
Test char_type classification.
string_type transform(const _CharT *__lo, const _CharT *__hi) const
Transform string to comparable form.
int compare(const string_type &__s) const
Compares this sub_match to a string.
regex_token_iterator< string::const_iterator > sregex_token_iterator
Token iterator for standard strings.
const _Facet & use_facet(const locale &__loc)
Return a facet.
basic_regex< wchar_t > wregex
Standard wide-character regular expressions.
const_reference prefix() const
Gets a sub_match representing the match prefix.
basic_regex & operator=(const _Ch_type *__p)
Replaces a regular expression with a new one constructed from a C-style null-terminated string...
static constexpr syntax_option_type awk
basic_regex(const basic_regex &__rhs)
Copy-constructs a basic regular expression.
unsigned int syntax_option_type
This is a bitmask type indicating how to interpret the regex.
static constexpr syntax_option_type grep
sub_match< wstring::const_iterator > wssub_match
Regex submatch over a standard wide string.
static constexpr match_flag_type format_default
static constexpr syntax_option_type optimize
regex_token_iterator()
Default constructs a regex_token_iterator.
const_reference suffix() const
Gets a sub_match representing the match suffix.
difference_type length() const
bool operator==(const match_results< _Bi_iter, _Allocator > &__m1, const match_results< _Bi_iter, _Allocator > &__m2)
Compares two match_results for equality.
reference operator[](size_type __n)
Subscript access to the data contained in the vector.
locale_type getloc() const
Gets the locale currently imbued in the regular expression object.
static std::size_t length(const char_type *__p)
Gives the length of a C-style string starting at __p.
string_type str(size_type __sub=0) const
Gets the match or submatch converted to a string type.
char_type translate_nocase(char_type __c) const
Translates a character into a case-insensitive equivalent.
regex_token_iterator & operator++()
Increments a regex_token_iterator.
basic_regex(_InputIterator __first, _InputIterator __last, flag_type __f=regex_constants::ECMAScript)
Constructs a basic regular expression from the range [first, last) interpreted according to the flags...
_BiIter second
first is a copy of the first object
match_results(match_results &&__rhs) noexcept
Move constructs a match_results.
static constexpr syntax_option_type extended
const_iterator cbegin() const
Gets an iterator to the start of the sub_match collection.
string_type lookup_collatename(_Fwd_iter __first, _Fwd_iter __last) const
Gets a collation element by name.
basic_regex(const _Ch_type *__p, flag_type __f=regex_constants::ECMAScript)
Constructs a basic regular expression from the sequence [p, p + char_traits<_Ch_type>::length(p)) int...
bool operator!=(const regex_token_iterator &__rhs)
Compares a regex_token_iterator to another for inequality.
difference_type position(size_type __sub=0) const
Gets the offset of the beginning of the indicated submatch.
string_type str() const
Gets the matching sequence as a string.
const value_type & operator*()
Dereferences a regex_token_iterator.
difference_type length(size_type __sub=0) const
Gets the length of the indicated submatch.
int compare(const sub_match &__s) const
Compares this and another matched sequence.