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>
218 template<
typename _Fwd_iter>
221 bool __icase =
false)
const
237 isctype(_Ch_type __c, char_class_type __f)
const;
250 value(_Ch_type __ch,
int __radix)
const;
266 std::swap(_M_locale, __loc);
276 {
return _M_locale; }
279 locale_type _M_locale;
282 template<
typename _Ch_type>
285 isctype(_Ch_type __c, char_class_type __f)
const
292 if (__ctype.
is(__f, __c))
296 if (__c == __ctype.
widen(
'_'))
298 const char __wb[] =
"w";
299 char_class_type __wt = this->lookup_classname(__wb,
300 __wb +
sizeof(__wb));
306 if (__ctype.
is(std::ctype_base::space, __c))
308 const char __bb[] =
"blank";
309 char_class_type __bt = this->lookup_classname(__bb,
310 __bb +
sizeof(__bb));
318 template<
typename _Ch_type>
321 value(_Ch_type __ch,
int __radix)
const
327 else if (__radix == 16)
330 return __is.
fail() ? -1 : __v;
341 template<
typename _Ch_type,
typename _Rx_traits = regex_traits<_Ch_type> >
346 typedef _Ch_type value_type;
347 typedef _Rx_traits traits_type;
348 typedef typename traits_type::string_type string_type;
350 typedef typename traits_type::locale_type locale_type;
385 : _M_flags(regex_constants::ECMAScript),
386 _M_automaton(__regex::__compile<const _Ch_type*, _Rx_traits>(0, 0,
387 _M_traits, _M_flags))
405 _M_automaton(__regex::__compile(__p, __p + _Rx_traits::length(__p),
406 _M_traits, _M_flags))
421 basic_regex(
const _Ch_type* __p, std::size_t __len, flag_type __f)
423 _M_automaton(__regex::__compile(__p, __p + __len, _M_traits, _M_flags))
432 : _M_flags(__rhs._M_flags), _M_traits(__rhs._M_traits),
433 _M_automaton(__rhs._M_automaton)
442 : _M_flags(__rhs._M_flags), _M_traits(__rhs._M_traits),
443 _M_automaton(std::move(__rhs._M_automaton))
455 template<
typename _Ch_traits,
typename _Ch_alloc>
461 _M_automaton(__regex::__compile(__s.
begin(), __s.
end(),
462 _M_traits, _M_flags))
478 template<
typename _InputIterator>
482 _M_automaton(__regex::__compile(__first, __last, _M_traits, _M_flags))
496 _M_automaton(__regex::__compile(__l.
begin(), __l.
end(),
497 _M_traits, _M_flags))
511 {
return this->
assign(__rhs); }
518 {
return this->
assign(std::move(__rhs)); }
537 template<
typename _Ch_typeraits,
typename _Allocator>
585 {
return this->
assign(string_type(__p), __flags); }
601 assign(
const _Ch_type* __p, std::size_t __len, flag_type __flags)
602 {
return this->
assign(string_type(__p, __len), __flags); }
615 template<
typename _Ch_typeraits,
typename _Allocator>
638 template<
typename _InputIterator>
640 assign(_InputIterator __first, _InputIterator __last,
642 {
return this->
assign(string_type(__first, __last), __flags); }
658 {
return this->
assign(__l.begin(), __l.end(), __flags); }
667 {
return _M_automaton->_M_sub_count() - 1; }
685 {
return _M_traits.imbue(__loc); }
693 {
return _M_traits.getloc(); }
704 std::swap(_M_flags, __rhs._M_flags);
705 std::swap(_M_traits, __rhs._M_traits);
706 std::swap(_M_automaton, __rhs._M_automaton);
709 #ifdef _GLIBCXX_DEBUG
712 { _M_automaton->_M_dot(__ostr); }
715 const __regex::_AutomatonPtr&
716 _M_get_automaton()
const
717 {
return _M_automaton; }
721 _Rx_traits _M_traits;
722 __regex::_AutomatonPtr _M_automaton;
727 #ifdef _GLIBCXX_USE_WCHAR_T
739 template<
typename _Ch_type,
typename _Rx_traits>
743 { __lhs.
swap(__rhs); }
759 template<
typename _BiIter>
763 typedef typename iterator_traits<_BiIter>::value_type value_type;
764 typedef typename iterator_traits<_BiIter>::difference_type
766 typedef _BiIter iterator;
856 #ifdef _GLIBCXX_USE_WCHAR_T
871 template<
typename _BiIter>
875 {
return __lhs.
compare(__rhs) == 0; }
883 template<
typename _BiIter>
887 {
return __lhs.
compare(__rhs) != 0; }
895 template<
typename _BiIter>
897 operator<(const sub_match<_BiIter>& __lhs,
899 {
return __lhs.
compare(__rhs) < 0; }
907 template<
typename _BiIter>
909 operator<=(const sub_match<_BiIter>& __lhs,
911 {
return __lhs.
compare(__rhs) <= 0; }
919 template<
typename _BiIter>
923 {
return __lhs.
compare(__rhs) >= 0; }
931 template<
typename _BiIter>
935 {
return __lhs.
compare(__rhs) > 0; }
944 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
947 typename iterator_traits<_Bi_iter>::value_type,
948 _Ch_traits, _Ch_alloc>& __lhs,
950 {
return __rhs.
compare(__lhs.c_str()) == 0; }
959 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
962 typename iterator_traits<_Bi_iter>::value_type,
964 {
return !(__lhs == __rhs); }
972 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
975 typename iterator_traits<_Bi_iter>::value_type,
977 {
return __rhs.
compare(__lhs.c_str()) > 0; }
985 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
988 typename iterator_traits<_Bi_iter>::value_type,
990 {
return __rhs < __lhs; }
998 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1001 typename iterator_traits<_Bi_iter>::value_type,
1003 {
return !(__lhs < __rhs); }
1011 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1014 typename iterator_traits<_Bi_iter>::value_type,
1016 {
return !(__rhs < __lhs); }
1025 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1029 typename iterator_traits<_Bi_iter>::value_type,
1030 _Ch_traits, _Ch_alloc>& __rhs)
1031 {
return __lhs.
compare(__rhs.c_str()) == 0; }
1040 template<
typename _Bi_iter,
typename _Ch_traits,
typename _Ch_alloc>
1044 typename iterator_traits<_Bi_iter>::value_type,
1045 _Ch_traits, _Ch_alloc>& __rhs)
1046 {
return !(__lhs == __rhs); }
1054 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1056 operator<(const sub_match<_Bi_iter>& __lhs,
1058 typename iterator_traits<_Bi_iter>::value_type,
1059 _Ch_traits, _Ch_alloc>& __rhs)
1060 {
return __lhs.
compare(__rhs.c_str()) < 0; }
1068 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1072 typename iterator_traits<_Bi_iter>::value_type,
1073 _Ch_traits, _Ch_alloc>& __rhs)
1074 {
return __rhs < __lhs; }
1082 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1086 typename iterator_traits<_Bi_iter>::value_type,
1087 _Ch_traits, _Ch_alloc>& __rhs)
1088 {
return !(__lhs < __rhs); }
1096 template<
typename _Bi_iter,
class _Ch_traits,
class _Ch_alloc>
1098 operator<=(const sub_match<_Bi_iter>& __lhs,
1100 typename iterator_traits<_Bi_iter>::value_type,
1101 _Ch_traits, _Ch_alloc>& __rhs)
1102 {
return !(__rhs < __lhs); }
1111 template<
typename _Bi_iter>
1113 operator==(
typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1115 {
return __rhs.
compare(__lhs) == 0; }
1124 template<
typename _Bi_iter>
1126 operator!=(
typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1128 {
return !(__lhs == __rhs); }
1136 template<
typename _Bi_iter>
1138 operator<(typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1140 {
return __rhs.
compare(__lhs) > 0; }
1148 template<
typename _Bi_iter>
1150 operator>(
typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1152 {
return __rhs < __lhs; }
1160 template<
typename _Bi_iter>
1162 operator>=(
typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1164 {
return !(__lhs < __rhs); }
1172 template<
typename _Bi_iter>
1174 operator<=(typename iterator_traits<_Bi_iter>::value_type
const* __lhs,
1176 {
return !(__rhs < __lhs); }
1185 template<
typename _Bi_iter>
1188 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1189 {
return __lhs.
compare(__rhs) == 0; }
1198 template<
typename _Bi_iter>
1201 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1202 {
return !(__lhs == __rhs); }
1210 template<
typename _Bi_iter>
1212 operator<(const sub_match<_Bi_iter>& __lhs,
1213 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1214 {
return __lhs.compare(__rhs) < 0; }
1222 template<
typename _Bi_iter>
1225 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1226 {
return __rhs < __lhs; }
1234 template<
typename _Bi_iter>
1237 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1238 {
return !(__lhs < __rhs); }
1246 template<
typename _Bi_iter>
1248 operator<=(const sub_match<_Bi_iter>& __lhs,
1249 typename iterator_traits<_Bi_iter>::value_type
const* __rhs)
1250 {
return !(__rhs < __lhs); }
1259 template<
typename _Bi_iter>
1261 operator==(
typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1275 template<
typename _Bi_iter>
1277 operator!=(
typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1279 {
return !(__lhs == __rhs); }
1287 template<
typename _Bi_iter>
1289 operator<(typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1302 template<
typename _Bi_iter>
1304 operator>(
typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1306 {
return __rhs < __lhs; }
1314 template<
typename _Bi_iter>
1316 operator>=(
typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1318 {
return !(__lhs < __rhs); }
1326 template<
typename _Bi_iter>
1328 operator<=(typename iterator_traits<_Bi_iter>::value_type
const& __lhs,
1330 {
return !(__rhs < __lhs); }
1339 template<
typename _Bi_iter>
1342 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1355 template<
typename _Bi_iter>
1358 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1359 {
return !(__lhs == __rhs); }
1367 template<
typename _Bi_iter>
1369 operator<(const sub_match<_Bi_iter>& __lhs,
1370 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1382 template<
typename _Bi_iter>
1385 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1386 {
return __rhs < __lhs; }
1394 template<
typename _Bi_iter>
1397 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1398 {
return !(__lhs < __rhs); }
1406 template<
typename _Bi_iter>
1408 operator<=(const sub_match<_Bi_iter>& __lhs,
1409 typename iterator_traits<_Bi_iter>::value_type
const& __rhs)
1410 {
return !(__rhs < __lhs); }
1420 template<
typename _Ch_type,
typename _Ch_traits,
typename _Bi_iter>
1422 basic_ostream<_Ch_type, _Ch_traits>&
1423 operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
1425 {
return __os << __m.
str(); }
1432 template<
typename _Bi_iter>
1433 inline const sub_match<_Bi_iter>&
1436 static const sub_match<_Bi_iter> __unmatched = sub_match<_Bi_iter>();
1462 template<
typename _Bi_iter,
1463 typename _Allocator = allocator<sub_match<_Bi_iter> > >
1465 :
private std::vector<sub_match<_Bi_iter>, _Allocator>
1489 typedef typename _Base_type::const_iterator const_iterator;
1490 typedef const_iterator iterator;
1491 typedef typename std::iterator_traits<_Bi_iter>::difference_type
1495 typedef _Allocator allocator_type;
1496 typedef typename std::iterator_traits<_Bi_iter>::value_type
1584 return (__size && _Base_type::operator[](0).matched) ? __size - 2 : 0;
1598 {
return size() == 0; }
1617 {
return (*
this)[__sub].length(); }
1636 (*
this)[__sub].first) : -1;
1649 str(size_type __sub = 0)
const
1650 {
return (*
this)[__sub].str(); }
1666 _GLIBCXX_DEBUG_ASSERT(
ready() );
1667 return __sub <
size()
1669 : __unmatched_sub<_Bi_iter>();
1683 _GLIBCXX_DEBUG_ASSERT(
ready() );
1686 : __unmatched_sub<_Bi_iter>();
1700 _GLIBCXX_DEBUG_ASSERT(
ready() );
1703 : __unmatched_sub<_Bi_iter>();
1750 template<
typename _Out_iter>
1752 format(_Out_iter __out,
const char_type* __fmt_first,
1753 const char_type* __fmt_last,
1761 template<
typename _Out_iter,
typename _St,
typename _Sa>
1774 template<
typename _Out_iter,
typename _St,
typename _Sa>
1812 {
return _Base_type::get_allocator(); }
1830 friend class __regex::_SpecializedResults<_Bi_iter, _Allocator>;
1833 typedef match_results<const char*> cmatch;
1834 typedef match_results<string::const_iterator> smatch;
1835 #ifdef _GLIBCXX_USE_WCHAR_T
1836 typedef match_results<const wchar_t*> wcmatch;
1837 typedef match_results<wstring::const_iterator> wsmatch;
1846 template<
typename _Bi_iter,
typename _Allocator>
1870 template<
typename _Bi_iter,
class _Allocator>
1874 {
return !(__m1 == __m2); }
1884 template<
typename _Bi_iter,
typename _Allocator>
1888 { __lhs.
swap(__rhs); }
1913 template<
typename _Bi_iter,
typename _Allocator,
1914 typename _Ch_type,
typename _Rx_traits>
1924 __regex::_Automaton::_SizeT __sz = __a->_M_sub_count();
1925 __regex::_SpecializedCursor<_Bi_iter> __cs(__s, __e);
1926 __regex::_SpecializedResults<_Bi_iter, _Allocator> __r(__sz, __cs, __m);
1927 __regex::_Grep_matcher __matcher(__cs, __r, __a, __flags);
1928 return __m[0].matched;
1945 template<
typename _Bi_iter,
typename _Ch_type,
typename _Rx_traits>
1953 return regex_match(__first, __last, __what, __re, __flags);
1970 template<
typename _Ch_type,
typename _Allocator,
typename _Rx_traits>
1977 {
return regex_match(__s, __s + _Rx_traits::length(__s), __m, __re, __f); }
1993 template<
typename _Ch_traits,
typename _Ch_alloc,
1994 typename _Allocator,
typename _Ch_type,
typename _Rx_traits>
1998 _Ch_traits, _Ch_alloc>::const_iterator, _Allocator>& __m,
2017 template<
typename _Ch_type,
class _Rx_traits>
2023 {
return regex_match(__s, __s + _Rx_traits::length(__s), __re, __f); }
2038 template<
typename _Ch_traits,
typename _Str_allocator,
2039 typename _Ch_type,
typename _Rx_traits>
2063 template<
typename _Bi_iter,
typename _Allocator,
2064 typename _Ch_type,
typename _Rx_traits>
2085 template<
typename _Bi_iter,
typename _Ch_type,
typename _Rx_traits>
2093 return regex_search(__first, __last, __what, __re, __flags);
2109 template<
typename _Ch_type,
class _Allocator,
class _Rx_traits>
2116 {
return regex_search(__s, __s + _Rx_traits::length(__s), __m, __e, __f); }
2129 template<
typename _Ch_type,
typename _Rx_traits>
2135 {
return regex_search(__s, __s + _Rx_traits::length(__s), __e, __f); }
2148 template<
typename _Ch_traits,
typename _String_allocator,
2149 typename _Ch_type,
typename _Rx_traits>
2152 _String_allocator>& __s,
2156 {
return regex_search(__s.begin(), __s.end(), __e, __flags); }
2170 template<
typename _Ch_traits,
typename _Ch_alloc,
2171 typename _Allocator,
typename _Ch_type,
2172 typename _Rx_traits>
2176 _Ch_traits, _Ch_alloc>::const_iterator, _Allocator>& __m,
2197 template<
typename _Out_iter,
typename _Bi_iter,
2198 typename _Rx_traits,
typename _Ch_type>
2218 template<
typename _Rx_traits,
typename _Ch_type>
2219 inline basic_string<_Ch_type>
2228 __s.
begin(), __s.
end(), __e, __fmt, __flags);
2239 template<
typename _Bi_iter,
2240 typename _Ch_type =
typename iterator_traits<_Bi_iter>::value_type,
2241 typename _Rx_traits = regex_traits<_Ch_type> >
2247 typedef std::ptrdiff_t difference_type;
2341 #ifdef _GLIBCXX_USE_WCHAR_T
2354 template<
typename _Bi_iter,
2355 typename _Ch_type =
typename iterator_traits<_Bi_iter>::value_type,
2362 typedef std::ptrdiff_t difference_type;
2433 template<std::
size_t _Nm>
2436 const int (&__submatches)[_Nm],
2452 regex_token_iterator&
2453 operator=(
const regex_token_iterator& __rhs);
2460 operator==(
const regex_token_iterator& __rhs);
2467 operator!=(
const regex_token_iterator& __rhs);
2487 regex_token_iterator&
2494 regex_token_iterator
2500 position_iterator __position;
2511 #ifdef _GLIBCXX_USE_WCHAR_T
2519 _GLIBCXX_END_NAMESPACE_VERSION
static std::size_t length(const char_type *__p)
Gives the length of a C-style string starting at __p.
const_reference prefix() const
Gets a sub_match representing the match prefix.
regex_token_iterator()
Default constructs a regex_token_iterator.
basic_regex & operator=(const basic_regex &__rhs)
Assigns one regular expression to another.
size_type max_size() const _GLIBCXX_NOEXCEPT
const value_type & operator*()
int compare(const string_type &__s) const
Compares this sub_match to a string.
_BiIter first
second_type is the second bound type
bool empty() const
Indicates if the match_results contains no results.
bool is(mask __m, char_type __c) const
Test char_type classification.
const_reference suffix() const
Gets a sub_match representing the match suffix.
static constexpr match_flag_type format_default
_BiIter second
first is a copy of the first object
__size_type size_type
The allocator's size type.
int compare(const basic_string &__str) const
Compare to a string.
string_type format(const char_type *__fmt, regex_constants::match_flag_type __flags=regex_constants::format_default) const
basic_regex< char > regex
Standard regular expressions.
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...
const_iterator cbegin() const noexcept
match_results(match_results &&__rhs) noexcept
Move constructs a match_results.
Primary class template ctype facet.This template class defines classification and conversion function...
bool ready() const
Indicates if the match_results is ready.
sub_match< const wchar_t * > wcsub_match
Regex submatch over a C-style null-terminated wide string.
int compare(const sub_match &__s) const
Compares this and another matched sequence.
const value_type * operator->()
Selects a regex_token_iterator member.
void swap(match_results< _Bi_iter, _Allocator > &__lhs, match_results< _Bi_iter, _Allocator > &__rhs)
Swaps two match results.
string_type lookup_collatename(_Fwd_iter __first, _Fwd_iter __last) const
Gets a collation element by name.
difference_type length(size_type __sub=0) const
Gets the length of the indicated submatch.
basic_regex & assign(initializer_list< _Ch_type > __l, flag_type __flags=regex_constants::ECMAScript)
Assigns a new regular expression to a regex object.
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 inequality.
basic_regex(const basic_regex &__rhs)
Copy-constructs a basic regular expression.
bool operator==(const regex_token_iterator &__rhs)
Compares a regex_token_iterator to another for equality.
match_results(const _Allocator &__a=_Allocator())
Constructs a default match_results container.
static constexpr syntax_option_type icase
regex_token_iterator & operator=(const regex_token_iterator &__rhs)
Assigns a regex_token_iterator to another.
iterator end() _GLIBCXX_NOEXCEPT
basic_regex & operator=(const _Ch_type *__p)
Replaces a regular expression with a new one constructed from a C-style null-terminated string...
bool fail() const
Fast error checking.
regex_token_iterator< wstring::const_iterator > wsregex_token_iterator
Token iterator for standard wide-character strings.
void swap(vector &__x) noexcept(_Alloc_traits::_S_nothrow_swap())
Swaps data with another vector.
const_reference operator[](size_type __sub) const
Gets a sub_match reference for the match or submatch.
const_iterator begin() const
Gets an iterator to the start of the sub_match collection.
char_type translate_nocase(char_type __c) const
Translates a character into a case-insensitive equivalent.
size_type size() const _GLIBCXX_NOEXCEPT
Returns the number of characters in the string, not including any null-termination.
char_type widen(char __c) const
Widen char to char_type.
const _CharT * data() const _GLIBCXX_NOEXCEPT
Return const pointer to contents.
basic_regex & assign(const basic_string< _Ch_type, _Ch_typeraits, _Allocator > &__s, flag_type __flags=regex_constants::ECMAScript)
Assigns a new regular expression to a regex object from a string containing a regular expression patt...
basic_regex< wchar_t > wregex
Standard wide-character regular expressions.
flag_type flags() const
Gets the flags used to construct the regular expression or in the last call to assign().
_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
std::bitset< _S_match_flag_last > match_flag_type
This is a bitmask type indicating regex matching rules.
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...
bool operator==(const regex_iterator &__rhs)
bool operator==(const match_results< _Bi_iter, _Allocator > &__m1, const match_results< _Bi_iter, _Allocator > &__m2)
Compares two match_results for equality.
const_iterator end() const
Gets an iterator to one-past-the-end of the collection.
size_type size() const
Gets the number of matches and submatches.
_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
Describes aspects of a regular expression.
Container class for localization functionality.The locale class is first a class wrapper for C librar...
const value_type * operator->()
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...
iterator begin() _GLIBCXX_NOEXCEPT
bool operator!=(const regex_iterator &__rhs)
match_results & operator=(const match_results &__rhs)
Assigns rhs to *this.
void swap(match_results &__that)
Swaps the contents of two match_results.
~match_results()
Destroys a match_results object.
regex_traits()
Constructs a default traits object.
bool empty() const _GLIBCXX_NOEXCEPT
match_results & operator=(match_results &&__rhs)
Move-assigns rhs to *this.
allocator_type get_allocator() const
Gets a copy of the allocator.
ios_base & hex(ios_base &__base)
Calls base.setf(ios_base::hex, ios_base::basefield).
_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)
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...
size_type max_size() const
Gets the number of matches and submatches.
~basic_regex()
Destroys a basic regular expression.
match_results(const match_results &__rhs)
Copy constructs a match_results.
sub_match< wstring::const_iterator > wssub_match
Regex submatch over a standard wide string.
int compare(const value_type *__s) const
Compares this sub_match to a C-style string.
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...
string_type transform(const _CharT *__lo, const _CharT *__hi) const
Transform string to comparable form.
size_type size() const _GLIBCXX_NOEXCEPT
static constexpr syntax_option_type awk
basic_regex & operator=(const basic_string< _Ch_type, _Ch_typeraits, _Allocator > &__s)
Replaces a regular expression with a new one constructed from a string.
basic_regex & assign(const basic_regex &__rhs)
the real assignment operator.
string_type transform_primary(_Fwd_iter __first, _Fwd_iter __last) const
Gets a sort key for a character sequence, independant of case.
reference operator[](size_type __n)
Subscript access to the data contained in the vector.
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 & assign(basic_regex &&__rhs) noexcept
The move-assignment operator.
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initilizer_list.
iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
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)
The results of a match or search operation.
bool operator!=(const regex_token_iterator &__rhs)
Compares a regex_token_iterator to another for inequality.
bool equal(_II1 __first1, _II1 __last1, _II2 __first2)
Tests a range for element-wise equality.
basic_regex(const basic_regex &&__rhs) noexcept
Move-constructs 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...
string_type transform(_Fwd_iter __first, _Fwd_iter __last) const
Gets a sort key for a character sequence.
Managing sequences of characters and character-like objects.
regex_token_iterator< string::const_iterator > sregex_token_iterator
Token iterator for standard strings.
static constexpr syntax_option_type grep
string_type str(size_type __sub=0) const
Gets the match or submatch converted to a string type.
basic_regex(initializer_list< _Ch_type > __l, flag_type __f=regex_constants::ECMAScript)
Constructs a basic regular expression from an initializer list.
basic_regex & assign(_InputIterator __first, _InputIterator __last, flag_type __flags=regex_constants::ECMAScript)
Assigns a new regular expression to a regex object.
static constexpr syntax_option_type extended
Basis for explicit traits specializations.
void swap(basic_regex &__rhs)
Swaps the contents of two regular expression objects.
const_iterator cbegin() const
Gets an iterator to the start of the sub_match collection.
Struct holding two objects of arbitrary type.
difference_type position(size_type __sub=0) const
Gets the offset of the beginning of the indicated submatch.
iterator begin() _GLIBCXX_NOEXCEPT
locale_type getloc() const
Gets a copy of the current locale in use by the regex_traits object.
int value(_Ch_type __ch, int __radix) const
Converts a digit to an int.
static constexpr syntax_option_type nosubs
string_type str() const
Gets the matching sequence as a string.
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
Forward iterators support a superset of input iterator operations.
iterator end() _GLIBCXX_NOEXCEPT
const value_type & operator*()
Dereferences a regex_token_iterator.
regex_token_iterator< const char * > cregex_token_iterator
Token iterator for C-style NULL-terminated strings.
unsigned int syntax_option_type
This is a bitmask type indicating how to interpret the regex.
regex_iterator()
Provides a singular iterator, useful for indicating one-past-the-end of a range.
static constexpr syntax_option_type optimize
static constexpr syntax_option_type basic
locale_type imbue(locale_type __loc)
Imbues the regex_traits object with a copy of a new locale.
sub_match< string::const_iterator > ssub_match
Standard regex submatch over a standard string.
_CharT tolower(_CharT __c, const locale &__loc)
Convenience interface to ctype.tolower(__c).
basic_regex & operator=(basic_regex &&__rhs) noexcept
Move-assigns one regular expression to another.
const _Facet & use_facet(const locale &__loc)
Return a facet.
ios_base & oct(ios_base &__base)
Calls base.setf(ios_base::oct, ios_base::basefield).
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.
Controlling input for std::string.This class supports reading from objects of type std::basic_string...
static constexpr syntax_option_type ECMAScript
regex_iterator & operator=(const regex_iterator &__rhs)
back_insert_iterator< _Container > back_inserter(_Container &__x)
regex_token_iterator & operator++()
Increments a regex_token_iterator.
Facet for localized string comparison.
static constexpr syntax_option_type collate
const_iterator cend() const
Gets an iterator to one-past-the-end of the collection.
bool isctype(_Ch_type __c, char_class_type __f) const
Determines if c is a member of an identified class.
char_type translate(char_type __c) const
Performs the identity translation.
static constexpr match_flag_type match_default
locale_type imbue(locale_type __loc)
Imbues the regular expression object with the given locale.
regex_token_iterator< const wchar_t * > wcregex_token_iterator
Token iterator for C-style NULL-terminated wide strings.
sub_match< const char * > csub_match
Standard regex submatch over a C-style null-terminated string.
static constexpr syntax_option_type egrep
regex_iterator & operator++()
unsigned int mark_count() const
Gets the number of marked subexpressions within the regular expression.
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initilizer_list.
locale_type getloc() const
Gets the locale currently imbued in the regular expression object.
A standard container which offers fixed time access to individual elements in any order...