libstdc++
Regular Expressions
Collaboration diagram for Regular Expressions:

Modules

 Base and Implementation Classes
 

Namespaces

 std::regex_constants
 

Classes

class  std::basic_regex< _Ch_type, _Rx_traits >
 
class  std::match_results< _Bi_iter, _Alloc >
 
class  std::regex_error
 
class  std::regex_iterator< _Bi_iter, _Ch_type, _Rx_traits >
 
class  std::regex_token_iterator< _Bi_iter, _Ch_type, _Rx_traits >
 
struct  std::regex_traits< _Ch_type >
 
class  std::sub_match< _BiIter >
 

Typedefs

template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
using std::__sub_match_string = basic_string< typename iterator_traits< _Bi_iter >::value_type, _Ch_traits, _Ch_alloc >
 
typedef match_results< const
char * > 
std::cmatch
 
typedef regex_iterator< const
char * > 
std::cregex_iterator
 
typedef regex_token_iterator
< const char * > 
std::cregex_token_iterator
 
typedef sub_match< const char * > std::csub_match
 
typedef basic_regex< char > std::regex
 
typedef match_results
< string::const_iterator > 
std::smatch
 
typedef regex_iterator
< string::const_iterator > 
std::sregex_iterator
 
typedef regex_token_iterator
< string::const_iterator > 
std::sregex_token_iterator
 
typedef sub_match
< string::const_iterator > 
std::ssub_match
 
typedef match_results< const
wchar_t * > 
std::wcmatch
 
typedef regex_iterator< const
wchar_t * > 
std::wcregex_iterator
 
typedef regex_token_iterator
< const wchar_t * > 
std::wcregex_token_iterator
 
typedef sub_match< const
wchar_t * > 
std::wcsub_match
 
typedef basic_regex< wchar_t > std::wregex
 
typedef match_results
< wstring::const_iterator > 
std::wsmatch
 
typedef regex_iterator
< wstring::const_iterator > 
std::wsregex_iterator
 
typedef regex_token_iterator
< wstring::const_iterator > 
std::wsregex_token_iterator
 
typedef sub_match
< wstring::const_iterator > 
std::wssub_match
 

Functions

template<typename _Bi_iter >
const sub_match< _Bi_iter > & std::__unmatched_sub ()
 
template<typename _BiIter >
bool std::operator!= (const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
 
template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator!= (const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator!= (const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
 
template<typename _Bi_iter >
bool std::operator!= (typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator!= (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
 
template<typename _Bi_iter >
bool std::operator!= (typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator!= (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
 
template<typename _Bi_iter , class _Alloc >
bool std::operator!= (const match_results< _Bi_iter, _Alloc > &__m1, const match_results< _Bi_iter, _Alloc > &__m2)
 
template<typename _BiIter >
bool std::operator< (const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
 
template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator< (const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter , class _Ch_traits , class _Ch_alloc >
bool std::operator< (const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
 
template<typename _Bi_iter >
bool std::operator< (typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator< (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
 
template<typename _Bi_iter >
bool std::operator< (typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator< (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
 
template<typename _Ch_type , typename _Ch_traits , typename _Bi_iter >
basic_ostream< _Ch_type,
_Ch_traits > & 
std::operator<< (basic_ostream< _Ch_type, _Ch_traits > &__os, const sub_match< _Bi_iter > &__m)
 
template<typename _BiIter >
bool std::operator<= (const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
 
template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator<= (const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter , class _Ch_traits , class _Ch_alloc >
bool std::operator<= (const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
 
template<typename _Bi_iter >
bool std::operator<= (typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator<= (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
 
template<typename _Bi_iter >
bool std::operator<= (typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator<= (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
 
template<typename _BiIter >
bool std::operator== (const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
 
template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator== (const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator== (const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
 
template<typename _Bi_iter >
bool std::operator== (typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator== (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
 
template<typename _Bi_iter >
bool std::operator== (typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator== (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
 
template<typename _Bi_iter , typename _Alloc >
bool std::operator== (const match_results< _Bi_iter, _Alloc > &__m1, const match_results< _Bi_iter, _Alloc > &__m2)
 
template<typename _BiIter >
bool std::operator> (const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
 
template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator> (const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter , class _Ch_traits , class _Ch_alloc >
bool std::operator> (const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
 
template<typename _Bi_iter >
bool std::operator> (typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator> (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
 
template<typename _Bi_iter >
bool std::operator> (typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator> (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
 
template<typename _BiIter >
bool std::operator>= (const sub_match< _BiIter > &__lhs, const sub_match< _BiIter > &__rhs)
 
template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator>= (const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter , class _Ch_traits , class _Ch_alloc >
bool std::operator>= (const sub_match< _Bi_iter > &__lhs, const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &__rhs)
 
template<typename _Bi_iter >
bool std::operator>= (typename iterator_traits< _Bi_iter >::value_type const *__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator>= (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const *__rhs)
 
template<typename _Bi_iter >
bool std::operator>= (typename iterator_traits< _Bi_iter >::value_type const &__lhs, const sub_match< _Bi_iter > &__rhs)
 
template<typename _Bi_iter >
bool std::operator>= (const sub_match< _Bi_iter > &__lhs, typename iterator_traits< _Bi_iter >::value_type const &__rhs)
 
template<typename _Ch_type , typename _Rx_traits >
void std::swap (basic_regex< _Ch_type, _Rx_traits > &__lhs, basic_regex< _Ch_type, _Rx_traits > &__rhs)
 
template<typename _Bi_iter , typename _Alloc >
void std::swap (match_results< _Bi_iter, _Alloc > &__lhs, match_results< _Bi_iter, _Alloc > &__rhs)
 

Matching, Searching, and Replacing

template<typename _Bi_iter , typename _Alloc , typename _Ch_type , typename _Rx_traits >
bool std::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)
 
template<typename _Bi_iter , typename _Ch_type , typename _Rx_traits >
bool std::regex_match (_Bi_iter __first, _Bi_iter __last, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __flags=regex_constants::match_default)
 
template<typename _Ch_type , typename _Alloc , typename _Rx_traits >
bool std::regex_match (const _Ch_type *__s, match_results< const _Ch_type *, _Alloc > &__m, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __f=regex_constants::match_default)
 
template<typename _Ch_traits , typename _Ch_alloc , typename _Alloc , typename _Ch_type , typename _Rx_traits >
bool std::regex_match (const basic_string< _Ch_type, _Ch_traits, _Ch_alloc > &__s, match_results< typename basic_string< _Ch_type, _Ch_traits, _Ch_alloc >::const_iterator, _Alloc > &__m, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __flags=regex_constants::match_default)
 
template<typename _Ch_type , class _Rx_traits >
bool std::regex_match (const _Ch_type *__s, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __f=regex_constants::match_default)
 
template<typename _Ch_traits , typename _Str_allocator , typename _Ch_type , typename _Rx_traits >
bool std::regex_match (const basic_string< _Ch_type, _Ch_traits, _Str_allocator > &__s, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __flags=regex_constants::match_default)
 
template<typename _Bi_iter , typename _Alloc , typename _Ch_type , typename _Rx_traits >
bool std::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)
 
template<typename _Bi_iter , typename _Ch_type , typename _Rx_traits >
bool std::regex_search (_Bi_iter __first, _Bi_iter __last, const basic_regex< _Ch_type, _Rx_traits > &__re, regex_constants::match_flag_type __flags=regex_constants::match_default)
 
template<typename _Ch_type , class _Alloc , class _Rx_traits >
bool std::regex_search (const _Ch_type *__s, match_results< const _Ch_type *, _Alloc > &__m, const basic_regex< _Ch_type, _Rx_traits > &__e, regex_constants::match_flag_type __f=regex_constants::match_default)
 
template<typename _Ch_type , typename _Rx_traits >
bool std::regex_search (const _Ch_type *__s, const basic_regex< _Ch_type, _Rx_traits > &__e, regex_constants::match_flag_type __f=regex_constants::match_default)
 
template<typename _Ch_traits , typename _String_allocator , typename _Ch_type , typename _Rx_traits >
bool std::regex_search (const basic_string< _Ch_type, _Ch_traits, _String_allocator > &__s, const basic_regex< _Ch_type, _Rx_traits > &__e, regex_constants::match_flag_type __flags=regex_constants::match_default)
 
template<typename _Ch_traits , typename _Ch_alloc , typename _Alloc , typename _Ch_type , typename _Rx_traits >
bool std::regex_search (const basic_string< _Ch_type, _Ch_traits, _Ch_alloc > &__s, match_results< typename basic_string< _Ch_type, _Ch_traits, _Ch_alloc >::const_iterator, _Alloc > &__m, const basic_regex< _Ch_type, _Rx_traits > &__e, regex_constants::match_flag_type __f=regex_constants::match_default)
 
template<typename _Out_iter , typename _Bi_iter , typename _Rx_traits , typename _Ch_type , typename _St , typename _Sa >
_Out_iter std::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)
 
template<typename _Out_iter , typename _Bi_iter , typename _Rx_traits , typename _Ch_type >
_Out_iter std::regex_replace (_Out_iter __out, _Bi_iter __first, _Bi_iter __last, const basic_regex< _Ch_type, _Rx_traits > &__e, const _Ch_type *__fmt, regex_constants::match_flag_type __flags=regex_constants::match_default)
 
template<typename _Rx_traits , typename _Ch_type , typename _St , typename _Sa , typename _Fst , typename _Fsa >
basic_string< _Ch_type, _St, _Sa > std::regex_replace (const basic_string< _Ch_type, _St, _Sa > &__s, const basic_regex< _Ch_type, _Rx_traits > &__e, const basic_string< _Ch_type, _Fst, _Fsa > &__fmt, regex_constants::match_flag_type __flags=regex_constants::match_default)
 
template<typename _Rx_traits , typename _Ch_type , typename _St , typename _Sa >
basic_string< _Ch_type, _St, _Sa > std::regex_replace (const basic_string< _Ch_type, _St, _Sa > &__s, const basic_regex< _Ch_type, _Rx_traits > &__e, const _Ch_type *__fmt, regex_constants::match_flag_type __flags=regex_constants::match_default)
 
template<typename _Rx_traits , typename _Ch_type , typename _St , typename _Sa >
basic_string< _Ch_type > std::regex_replace (const _Ch_type *__s, 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)
 
template<typename _Rx_traits , typename _Ch_type >
basic_string< _Ch_type > std::regex_replace (const _Ch_type *__s, const basic_regex< _Ch_type, _Rx_traits > &__e, const _Ch_type *__fmt, regex_constants::match_flag_type __flags=regex_constants::match_default)
 

5.1 Regular Expression Syntax Options

enum  std::regex_constants::__syntax_option {
  _S_icase, _S_nosubs, _S_optimize, _S_collate,
  _S_ECMAScript, _S_basic, _S_extended, _S_awk,
  _S_grep, _S_egrep, _S_syntax_last
}
 
enum  std::regex_constants::syntax_option_type : unsigned int {
  std::regex_constants::icase, std::regex_constants::nosubs, std::regex_constants::optimize, std::regex_constants::collate,
  std::regex_constants::ECMAScript, std::regex_constants::basic, std::regex_constants::extended, std::regex_constants::awk,
  std::regex_constants::grep, std::regex_constants::egrep
}
 
constexpr syntax_option_type std::regex_constants::operator& (syntax_option_type __a, syntax_option_type __b)
 
constexpr syntax_option_type std::regex_constants::operator| (syntax_option_type __a, syntax_option_type __b)
 
constexpr syntax_option_type std::regex_constants::operator^ (syntax_option_type __a, syntax_option_type __b)
 
constexpr syntax_option_type std::regex_constants::operator~ (syntax_option_type __a)
 
syntax_option_type & std::regex_constants::operator&= (syntax_option_type &__a, syntax_option_type __b)
 
syntax_option_type & std::regex_constants::operator|= (syntax_option_type &__a, syntax_option_type __b)
 
syntax_option_type & std::regex_constants::operator^= (syntax_option_type &__a, syntax_option_type __b)
 

5.2 Matching Rules

Matching a regular expression against a sequence of characters [first, last) proceeds according to the rules of the grammar specified for the regular expression object, modified according to the effects listed below for any bitmask elements set.

enum  std::regex_constants::__match_flag {
  _S_not_bol, _S_not_eol, _S_not_bow, _S_not_eow,
  _S_any, _S_not_null, _S_continuous, _S_prev_avail,
  _S_sed, _S_no_copy, _S_first_only, _S_match_flag_last
}
 
enum  std::regex_constants::match_flag_type : unsigned int {
  std::regex_constants::match_default, std::regex_constants::match_not_bol, std::regex_constants::match_not_eol, std::regex_constants::match_not_bow,
  std::regex_constants::match_not_eow, std::regex_constants::match_any, std::regex_constants::match_not_null, std::regex_constants::match_continuous,
  std::regex_constants::match_prev_avail, std::regex_constants::format_default, std::regex_constants::format_sed, std::regex_constants::format_no_copy,
  std::regex_constants::format_first_only
}
 
constexpr match_flag_type std::regex_constants::operator& (match_flag_type __a, match_flag_type __b)
 
constexpr match_flag_type std::regex_constants::operator| (match_flag_type __a, match_flag_type __b)
 
constexpr match_flag_type std::regex_constants::operator^ (match_flag_type __a, match_flag_type __b)
 
constexpr match_flag_type std::regex_constants::operator~ (match_flag_type __a)
 
match_flag_type & std::regex_constants::operator&= (match_flag_type &__a, match_flag_type __b)
 
match_flag_type & std::regex_constants::operator|= (match_flag_type &__a, match_flag_type __b)
 
match_flag_type & std::regex_constants::operator^= (match_flag_type &__a, match_flag_type __b)
 

5.3 Error Types

enum  std::regex_constants::error_type {
  _S_error_collate, _S_error_ctype, _S_error_escape, _S_error_backref,
  _S_error_brack, _S_error_paren, _S_error_brace, _S_error_badbrace,
  _S_error_range, _S_error_space, _S_error_badrepeat, _S_error_complexity,
  _S_error_stack
}
 
constexpr error_type std::regex_constants::error_collate (_S_error_collate)
 
constexpr error_type std::regex_constants::error_ctype (_S_error_ctype)
 
constexpr error_type std::regex_constants::error_escape (_S_error_escape)
 
constexpr error_type std::regex_constants::error_backref (_S_error_backref)
 
constexpr error_type std::regex_constants::error_brack (_S_error_brack)
 
constexpr error_type std::regex_constants::error_paren (_S_error_paren)
 
constexpr error_type std::regex_constants::error_brace (_S_error_brace)
 
constexpr error_type std::regex_constants::error_badbrace (_S_error_badbrace)
 
constexpr error_type std::regex_constants::error_range (_S_error_range)
 
constexpr error_type std::regex_constants::error_space (_S_error_space)
 
constexpr error_type std::regex_constants::error_badrepeat (_S_error_badrepeat)
 
constexpr error_type std::regex_constants::error_complexity (_S_error_complexity)
 
constexpr error_type std::regex_constants::error_stack (_S_error_stack)
 

Detailed Description

A facility for performing regular expression pattern matching.

Typedef Documentation

typedef regex_token_iterator<const char*> std::cregex_token_iterator

Token iterator for C-style NULL-terminated strings.

Definition at line 2714 of file regex.h.

typedef sub_match<const char*> std::csub_match

Standard regex submatch over a C-style null-terminated string.

Definition at line 928 of file regex.h.

typedef basic_regex<char> std::regex

Standard regular expressions.

Definition at line 800 of file regex.h.

typedef regex_token_iterator<string::const_iterator> std::sregex_token_iterator

Token iterator for standard strings.

Definition at line 2717 of file regex.h.

typedef sub_match<string::const_iterator> std::ssub_match

Standard regex submatch over a standard string.

Definition at line 931 of file regex.h.

typedef regex_token_iterator<const wchar_t*> std::wcregex_token_iterator

Token iterator for C-style NULL-terminated wide strings.

Definition at line 2721 of file regex.h.

typedef sub_match<const wchar_t*> std::wcsub_match

Regex submatch over a C-style null-terminated wide string.

Definition at line 935 of file regex.h.

typedef basic_regex<wchar_t> std::wregex

Standard wide-character regular expressions.

Definition at line 804 of file regex.h.

typedef regex_token_iterator<wstring::const_iterator> std::wsregex_token_iterator

Token iterator for standard wide-character strings.

Definition at line 2724 of file regex.h.

typedef sub_match<wstring::const_iterator> std::wssub_match

Regex submatch over a standard wide string.

Definition at line 938 of file regex.h.

Enumeration Type Documentation

This is a bitmask type indicating regex matching rules.

The match_flag_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

Definition at line 213 of file regex_constants.h.

This is a bitmask type indicating how to interpret the regex.

The syntax_option_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep set.

Definition at line 54 of file regex_constants.h.

The expression contained an invalid collating element name.

Definition at line 49 of file regex_error.h.

This is a bitmask type indicating regex matching rules.

The match_flag_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

Enumerator
match_default 

The default matching rules.

match_not_bol 

The first character in the sequence [first, last) is treated as though it is not at the beginning of a line, so the character (^) in the regular expression shall not match [first, first).

match_not_eol 

The last character in the sequence [first, last) is treated as though it is not at the end of a line, so the character ($) in the regular expression shall not match [last, last).

match_not_bow 

The expression \b is not matched against the sub-sequence [first,first).

match_not_eow 

The expression \b should not be matched against the sub-sequence [last,last).

match_any 

If more than one match is possible then any match is an acceptable result.

match_not_null 

The expression does not match an empty sequence.

match_continuous 

The expression only matches a sub-sequence that begins at first .

match_prev_avail 

–first is a valid iterator position. When this flag is set then the flags match_not_bol and match_not_bow are ignored by the regular expression algorithms 28.11 and iterators 28.12.

format_default 

When a regular expression match is to be replaced by a new string, the new string is constructed using the rules used by the ECMAScript replace function in ECMA- 262 [Ecma International, ECMAScript Language Specification, Standard Ecma-262, third edition, 1999], part 15.5.4.11 String.prototype.replace. In addition, during search and replace operations all non-overlapping occurrences of the regular expression are located and replaced, and sections of the input that did not match the expression are copied unchanged to the output string.

Format strings (from ECMA-262 [15.5.4.11]):

  • $$ The dollar-sign itself ($)
  • $& The matched substring.
  • $` The portion of string that precedes the matched substring. This would be match_results::prefix().
  • $' The portion of string that follows the matched substring. This would be match_results::suffix().
  • $n The nth capture, where n is in [1,9] and $n is not followed by a decimal digit. If n <= match_results::size() and the nth capture is undefined, use the empty string instead. If n > match_results::size(), the result is implementation-defined.
  • $nn The nnth capture, where nn is a two-digit decimal number on [01, 99]. If nn <= match_results::size() and the nth capture is undefined, use the empty string instead. If nn > match_results::size(), the result is implementation-defined.
format_sed 

When a regular expression match is to be replaced by a new string, the new string is constructed using the rules used by the POSIX sed utility in IEEE Std 1003.1- 2001 [IEEE, Information Technology – Portable Operating System Interface (POSIX), IEEE Standard 1003.1-2001].

format_no_copy 

During a search and replace operation, sections of the character container sequence being searched that do not match the regular expression shall not be copied to the output string.

format_first_only 

When specified during a search and replace operation, only the first occurrence of the regular expression shall be replaced.

Definition at line 236 of file regex_constants.h.

This is a bitmask type indicating how to interpret the regex.

The syntax_option_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep set.

Enumerator
icase 

Specifies that the matching of regular expressions against a character sequence shall be performed without regard to case.

nosubs 

Specifies that when a regular expression is matched against a character container sequence, no sub-expression matches are to be stored in the supplied match_results structure.

optimize 

Specifies that the regular expression engine should pay more attention to the speed with which regular expressions are matched, and less to the speed with which regular expression objects are constructed. Otherwise it has no detectable effect on the program output.

collate 

Specifies that character ranges of the form [a-b] should be locale sensitive.

ECMAScript 

Specifies that the grammar recognized by the regular expression engine is that used by ECMAScript in ECMA-262 [Ecma International, ECMAScript Language Specification, Standard Ecma-262, third edition, 1999], as modified in section [28.13]. This grammar is similar to that defined in the PERL scripting language but extended with elements found in the POSIX regular expression grammar.

basic 

Specifies that the grammar recognized by the regular expression engine is that used by POSIX basic regular expressions in IEEE Std 1003.1-2001, Portable Operating System Interface (POSIX), Base Definitions and Headers, Section 9, Regular Expressions [IEEE, Information Technology – Portable Operating System Interface (POSIX), IEEE Standard 1003.1-2001].

extended 

Specifies that the grammar recognized by the regular expression engine is that used by POSIX extended regular expressions in IEEE Std 1003.1-2001, Portable Operating System Interface (POSIX), Base Definitions and Headers, Section 9, Regular Expressions.

awk 

Specifies that the grammar recognized by the regular expression engine is that used by POSIX utility awk in IEEE Std 1003.1-2001. This option is identical to syntax_option_type extended, except that C-style escape sequences are supported. These sequences are: \\, \a, \b, \f, \n, \r, \t , \v, \&apos,, &apos,, and \ddd (where ddd is one, two, or three octal digits).

grep 

Specifies that the grammar recognized by the regular expression engine is that used by POSIX utility grep in IEEE Std 1003.1-2001. This option is identical to syntax_option_type basic, except that newlines are treated as whitespace.

egrep 

Specifies that the grammar recognized by the regular expression engine is that used by POSIX utility grep when given the -E option in IEEE Std 1003.1-2001. This option is identical to syntax_option_type extended, except that newlines are treated as whitespace.

Definition at line 80 of file regex_constants.h.

Function Documentation

constexpr error_type std::regex_constants::error_backref ( _S_error_backref  )

The expression contained an invalid back reference.

constexpr error_type std::regex_constants::error_badbrace ( _S_error_badbrace  )

The expression contained an invalid range in a {} expression.

constexpr error_type std::regex_constants::error_badrepeat ( _S_error_badrepeat  )

One of *?+{ was not preceded by a valid regular expression.

constexpr error_type std::regex_constants::error_brace ( _S_error_brace  )

The expression contained mismatched { and }

constexpr error_type std::regex_constants::error_brack ( _S_error_brack  )

The expression contained mismatched [ and ].

constexpr error_type std::regex_constants::error_collate ( _S_error_collate  )

The expression contained an invalid collating element name.

constexpr error_type std::regex_constants::error_complexity ( _S_error_complexity  )

The complexity of an attempted match against a regular expression exceeded a pre-set level.

constexpr error_type std::regex_constants::error_ctype ( _S_error_ctype  )

The expression contained an invalid character class name.

constexpr error_type std::regex_constants::error_escape ( _S_error_escape  )

The expression contained an invalid escaped character, or a trailing escape.

constexpr error_type std::regex_constants::error_paren ( _S_error_paren  )

The expression contained mismatched ( and ).

constexpr error_type std::regex_constants::error_range ( _S_error_range  )

The expression contained an invalid character range, such as [b-a] in most encodings.

constexpr error_type std::regex_constants::error_space ( _S_error_space  )

There was insufficient memory to convert the expression into a finite state machine.

constexpr error_type std::regex_constants::error_stack ( _S_error_stack  )

There was insufficient memory to determine whether the regular expression could match the specified character sequence.

template<typename _BiIter >
bool std::operator!= ( const sub_match< _BiIter > &  __lhs,
const sub_match< _BiIter > &  __rhs 
)
inline

Tests the inequivalence of two regular expression submatches.

Parameters
__lhsFirst regular expression submatch.
__rhsSecond regular expression submatch.
Returns
true if __lhs is not equivalent to __rhs, false otherwise.

Definition at line 962 of file regex.h.

References std::sub_match< _BiIter >::compare().

template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator!= ( const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the inequivalence of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs is not equivalent to __rhs, false otherwise.

Definition at line 1037 of file regex.h.

template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator!= ( const sub_match< _Bi_iter > &  __lhs,
const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __rhs 
)
inline

Tests the inequivalence of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs is not equivalent to __rhs, false otherwise.

Definition at line 1111 of file regex.h.

template<typename _Bi_iter >
bool std::operator!= ( typename iterator_traits< _Bi_iter >::value_type const *  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the inequivalence of an iterator value and a regular expression submatch.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs is not equivalent to __rhs, false otherwise.

Definition at line 1185 of file regex.h.

template<typename _Bi_iter >
bool std::operator!= ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const *  __rhs 
)
inline

Tests the inequivalence of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA pointer to a string.
Returns
true if __lhs is not equivalent to __rhs, false otherwise.

Definition at line 1259 of file regex.h.

template<typename _Bi_iter >
bool std::operator!= ( typename iterator_traits< _Bi_iter >::value_type const &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the inequivalence of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs is not equivalent to __rhs, false otherwise.

Definition at line 1336 of file regex.h.

template<typename _Bi_iter >
bool std::operator!= ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const &  __rhs 
)
inline

Tests the inequivalence of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA const string reference.
Returns
true if __lhs is not equivalent to __rhs, false otherwise.

Definition at line 1416 of file regex.h.

template<typename _Bi_iter , class _Alloc >
bool std::operator!= ( const match_results< _Bi_iter, _Alloc > &  __m1,
const match_results< _Bi_iter, _Alloc > &  __m2 
)
inline

Compares two match_results for inequality.

Returns
true if the two objects do not refer to the same match, false otherwise.

Definition at line 1930 of file regex.h.

constexpr syntax_option_type std::regex_constants::operator& ( syntax_option_type  __a,
syntax_option_type  __b 
)
inline

This is a bitmask type indicating how to interpret the regex.

The syntax_option_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep set.

Definition at line 164 of file regex_constants.h.

constexpr match_flag_type std::regex_constants::operator& ( match_flag_type  __a,
match_flag_type  __b 
)
inline

This is a bitmask type indicating regex matching rules.

The match_flag_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

Definition at line 343 of file regex_constants.h.

syntax_option_type& std::regex_constants::operator&= ( syntax_option_type &  __a,
syntax_option_type  __b 
)
inline

This is a bitmask type indicating how to interpret the regex.

The syntax_option_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep set.

Definition at line 189 of file regex_constants.h.

match_flag_type& std::regex_constants::operator&= ( match_flag_type &  __a,
match_flag_type  __b 
)
inline

This is a bitmask type indicating regex matching rules.

The match_flag_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

Definition at line 368 of file regex_constants.h.

template<typename _BiIter >
bool std::operator< ( const sub_match< _BiIter > &  __lhs,
const sub_match< _BiIter > &  __rhs 
)
inline

Tests the ordering of two regular expression submatches.

Parameters
__lhsFirst regular expression submatch.
__rhsSecond regular expression submatch.
Returns
true if __lhs precedes __rhs, false otherwise.

Definition at line 973 of file regex.h.

template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator< ( const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs precedes __rhs, false otherwise.

Definition at line 1049 of file regex.h.

template<typename _Bi_iter , class _Ch_traits , class _Ch_alloc >
bool std::operator< ( const sub_match< _Bi_iter > &  __lhs,
const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs precedes __rhs, false otherwise.

Definition at line 1123 of file regex.h.

template<typename _Bi_iter >
bool std::operator< ( typename iterator_traits< _Bi_iter >::value_type const *  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs precedes __rhs, false otherwise.

Definition at line 1197 of file regex.h.

template<typename _Bi_iter >
bool std::operator< ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const *  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs precedes __rhs, false otherwise.

Definition at line 1271 of file regex.h.

template<typename _Bi_iter >
bool std::operator< ( typename iterator_traits< _Bi_iter >::value_type const &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs precedes __rhs, false otherwise.

Definition at line 1348 of file regex.h.

template<typename _Bi_iter >
bool std::operator< ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const &  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA const string reference.
Returns
true if __lhs precedes __rhs, false otherwise.

Definition at line 1428 of file regex.h.

References std::sub_match< _BiIter >::compare().

template<typename _Ch_type , typename _Ch_traits , typename _Bi_iter >
basic_ostream<_Ch_type, _Ch_traits>& std::operator<< ( basic_ostream< _Ch_type, _Ch_traits > &  __os,
const sub_match< _Bi_iter > &  __m 
)
inline

Inserts a matched string into an output stream.

Parameters
__osThe output stream.
__mA submatch string.
Returns
the output stream with the submatch string inserted.

Definition at line 1482 of file regex.h.

References std::sub_match< _BiIter >::str().

template<typename _BiIter >
bool std::operator<= ( const sub_match< _BiIter > &  __lhs,
const sub_match< _BiIter > &  __rhs 
)
inline

Tests the ordering of two regular expression submatches.

Parameters
__lhsFirst regular expression submatch.
__rhsSecond regular expression submatch.
Returns
true if __lhs does not succeed __rhs, false otherwise.

Definition at line 984 of file regex.h.

template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator<= ( const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs does not succeed __rhs, false otherwise.

Definition at line 1085 of file regex.h.

template<typename _Bi_iter , class _Ch_traits , class _Ch_alloc >
bool std::operator<= ( const sub_match< _Bi_iter > &  __lhs,
const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs does not succeed __rhs, false otherwise.

Definition at line 1159 of file regex.h.

template<typename _Bi_iter >
bool std::operator<= ( typename iterator_traits< _Bi_iter >::value_type const *  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs does not succeed __rhs, false otherwise.

Definition at line 1233 of file regex.h.

template<typename _Bi_iter >
bool std::operator<= ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const *  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs does not succeed __rhs, false otherwise.

Definition at line 1307 of file regex.h.

template<typename _Bi_iter >
bool std::operator<= ( typename iterator_traits< _Bi_iter >::value_type const &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs does not succeed __rhs, false otherwise.

Definition at line 1387 of file regex.h.

template<typename _Bi_iter >
bool std::operator<= ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const &  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA const string reference.
Returns
true if __lhs does not succeed __rhs, false otherwise.

Definition at line 1467 of file regex.h.

template<typename _BiIter >
bool std::operator== ( const sub_match< _BiIter > &  __lhs,
const sub_match< _BiIter > &  __rhs 
)
inline

Tests the equivalence of two regular expression submatches.

Parameters
__lhsFirst regular expression submatch.
__rhsSecond regular expression submatch.
Returns
true if __lhs is equivalent to __rhs, false otherwise.

Definition at line 951 of file regex.h.

References std::sub_match< _BiIter >::compare().

template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator== ( const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the equivalence of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs is equivalent to __rhs, false otherwise.

Definition at line 1024 of file regex.h.

References std::basic_string< _CharT, _Traits, _Alloc >::c_str(), and std::sub_match< _BiIter >::compare().

template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator== ( const sub_match< _Bi_iter > &  __lhs,
const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __rhs 
)
inline

Tests the equivalence of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs is equivalent to __rhs, false otherwise.

Definition at line 1098 of file regex.h.

References std::basic_string< _CharT, _Traits, _Alloc >::c_str(), and std::sub_match< _BiIter >::compare().

template<typename _Bi_iter >
bool std::operator== ( typename iterator_traits< _Bi_iter >::value_type const *  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the equivalence of a C string and a regular expression submatch.

Parameters
__lhsA C string.
__rhsA regular expression submatch.
Returns
true if __lhs is equivalent to __rhs, false otherwise.

Definition at line 1172 of file regex.h.

References std::sub_match< _BiIter >::compare().

template<typename _Bi_iter >
bool std::operator== ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const *  __rhs 
)
inline

Tests the equivalence of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA pointer to a string?
Returns
true if __lhs is equivalent to __rhs, false otherwise.

Definition at line 1246 of file regex.h.

References std::sub_match< _BiIter >::compare().

template<typename _Bi_iter >
bool std::operator== ( typename iterator_traits< _Bi_iter >::value_type const &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the equivalence of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs is equivalent to __rhs, false otherwise.

Definition at line 1320 of file regex.h.

References std::sub_match< _BiIter >::compare().

template<typename _Bi_iter >
bool std::operator== ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const &  __rhs 
)
inline

Tests the equivalence of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA const string reference.
Returns
true if __lhs is equivalent to __rhs, false otherwise.

Definition at line 1400 of file regex.h.

References std::sub_match< _BiIter >::compare().

template<typename _Bi_iter , typename _Alloc >
bool std::operator== ( const match_results< _Bi_iter, _Alloc > &  __m1,
const match_results< _Bi_iter, _Alloc > &  __m2 
)
inline

Compares two match_results for equality.

Returns
true if the two objects refer to the same match, false otherwise.

Definition at line 1906 of file regex.h.

References std::equal().

template<typename _BiIter >
bool std::operator> ( const sub_match< _BiIter > &  __lhs,
const sub_match< _BiIter > &  __rhs 
)
inline

Tests the ordering of two regular expression submatches.

Parameters
__lhsFirst regular expression submatch.
__rhsSecond regular expression submatch.
Returns
true if __lhs succeeds __rhs, false otherwise.

Definition at line 1006 of file regex.h.

References std::sub_match< _BiIter >::compare().

template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator> ( const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs succeeds __rhs, false otherwise.

Definition at line 1061 of file regex.h.

template<typename _Bi_iter , class _Ch_traits , class _Ch_alloc >
bool std::operator> ( const sub_match< _Bi_iter > &  __lhs,
const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs succeeds __rhs, false otherwise.

Definition at line 1135 of file regex.h.

template<typename _Bi_iter >
bool std::operator> ( typename iterator_traits< _Bi_iter >::value_type const *  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs succeeds __rhs, false otherwise.

Definition at line 1209 of file regex.h.

template<typename _Bi_iter >
bool std::operator> ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const *  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs succeeds __rhs, false otherwise.

Definition at line 1283 of file regex.h.

template<typename _Bi_iter >
bool std::operator> ( typename iterator_traits< _Bi_iter >::value_type const &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs succeeds __rhs, false otherwise.

Definition at line 1363 of file regex.h.

template<typename _Bi_iter >
bool std::operator> ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const &  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA const string reference.
Returns
true if __lhs succeeds __rhs, false otherwise.

Definition at line 1443 of file regex.h.

template<typename _BiIter >
bool std::operator>= ( const sub_match< _BiIter > &  __lhs,
const sub_match< _BiIter > &  __rhs 
)
inline

Tests the ordering of two regular expression submatches.

Parameters
__lhsFirst regular expression submatch.
__rhsSecond regular expression submatch.
Returns
true if __lhs does not precede __rhs, false otherwise.

Definition at line 995 of file regex.h.

References std::sub_match< _BiIter >::compare().

template<typename _Bi_iter , typename _Ch_traits , typename _Ch_alloc >
bool std::operator>= ( const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs does not precede __rhs, false otherwise.

Definition at line 1073 of file regex.h.

template<typename _Bi_iter , class _Ch_traits , class _Ch_alloc >
bool std::operator>= ( const sub_match< _Bi_iter > &  __lhs,
const __sub_match_string< _Bi_iter, _Ch_traits, _Ch_alloc > &  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs does not precede __rhs, false otherwise.

Definition at line 1147 of file regex.h.

template<typename _Bi_iter >
bool std::operator>= ( typename iterator_traits< _Bi_iter >::value_type const *  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs does not precede __rhs, false otherwise.

Definition at line 1221 of file regex.h.

template<typename _Bi_iter >
bool std::operator>= ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const *  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA string.
Returns
true if __lhs does not precede __rhs, false otherwise.

Definition at line 1295 of file regex.h.

template<typename _Bi_iter >
bool std::operator>= ( typename iterator_traits< _Bi_iter >::value_type const &  __lhs,
const sub_match< _Bi_iter > &  __rhs 
)
inline

Tests the ordering of a string and a regular expression submatch.

Parameters
__lhsA string.
__rhsA regular expression submatch.
Returns
true if __lhs does not precede __rhs, false otherwise.

Definition at line 1375 of file regex.h.

template<typename _Bi_iter >
bool std::operator>= ( const sub_match< _Bi_iter > &  __lhs,
typename iterator_traits< _Bi_iter >::value_type const &  __rhs 
)
inline

Tests the ordering of a regular expression submatch and a string.

Parameters
__lhsA regular expression submatch.
__rhsA const string reference.
Returns
true if __lhs does not precede __rhs, false otherwise.

Definition at line 1455 of file regex.h.

constexpr syntax_option_type std::regex_constants::operator^ ( syntax_option_type  __a,
syntax_option_type  __b 
)
inline

This is a bitmask type indicating how to interpret the regex.

The syntax_option_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep set.

Definition at line 178 of file regex_constants.h.

constexpr match_flag_type std::regex_constants::operator^ ( match_flag_type  __a,
match_flag_type  __b 
)
inline

This is a bitmask type indicating regex matching rules.

The match_flag_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

Definition at line 357 of file regex_constants.h.

syntax_option_type& std::regex_constants::operator^= ( syntax_option_type &  __a,
syntax_option_type  __b 
)
inline

This is a bitmask type indicating how to interpret the regex.

The syntax_option_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep set.

Definition at line 197 of file regex_constants.h.

match_flag_type& std::regex_constants::operator^= ( match_flag_type &  __a,
match_flag_type  __b 
)
inline

This is a bitmask type indicating regex matching rules.

The match_flag_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

Definition at line 376 of file regex_constants.h.

constexpr syntax_option_type std::regex_constants::operator| ( syntax_option_type  __a,
syntax_option_type  __b 
)
inline

This is a bitmask type indicating how to interpret the regex.

The syntax_option_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep set.

Definition at line 171 of file regex_constants.h.

constexpr match_flag_type std::regex_constants::operator| ( match_flag_type  __a,
match_flag_type  __b 
)
inline

This is a bitmask type indicating regex matching rules.

The match_flag_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

Definition at line 350 of file regex_constants.h.

syntax_option_type& std::regex_constants::operator|= ( syntax_option_type &  __a,
syntax_option_type  __b 
)
inline

This is a bitmask type indicating how to interpret the regex.

The syntax_option_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep set.

Definition at line 193 of file regex_constants.h.

match_flag_type& std::regex_constants::operator|= ( match_flag_type &  __a,
match_flag_type  __b 
)
inline

This is a bitmask type indicating regex matching rules.

The match_flag_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

Definition at line 372 of file regex_constants.h.

constexpr syntax_option_type std::regex_constants::operator~ ( syntax_option_type  __a)
inline

This is a bitmask type indicating how to interpret the regex.

The syntax_option_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep set.

Definition at line 185 of file regex_constants.h.

constexpr match_flag_type std::regex_constants::operator~ ( match_flag_type  __a)
inline

This is a bitmask type indicating regex matching rules.

The match_flag_type is implementation defined but it is valid to perform bitwise operations on these values and expect the right thing to happen.

Definition at line 364 of file regex_constants.h.

template<typename _Bi_iter , typename _Alloc , typename _Ch_type , typename _Rx_traits >
bool std::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 
)
inline

Determines if there is a match between the regular expression e and all of the character sequence [first, last).

Parameters
__sStart of the character sequence to match.
__eOne-past-the-end of the character sequence to match.
__mThe match results.
__reThe regular expression.
__flagsControls how the regular expression is matched.
Return values
trueA match exists.
falseOtherwise.
Exceptions
anexception of type regex_error.

Definition at line 1972 of file regex.h.

Referenced by std::regex_match().

template<typename _Bi_iter , typename _Ch_type , typename _Rx_traits >
bool std::regex_match ( _Bi_iter  __first,
_Bi_iter  __last,
const basic_regex< _Ch_type, _Rx_traits > &  __re,
regex_constants::match_flag_type  __flags = regex_constants::match_default 
)
inline

Indicates if there is a match between the regular expression e and all of the character sequence [first, last).

Parameters
__firstBeginning of the character sequence to match.
__lastOne-past-the-end of the character sequence to match.
__reThe regular expression.
__flagsControls how the regular expression is matched.
Return values
trueA match exists.
falseOtherwise.
Exceptions
anexception of type regex_error.

Definition at line 2000 of file regex.h.

References std::regex_match().

template<typename _Ch_type , typename _Alloc , typename _Rx_traits >
bool std::regex_match ( const _Ch_type *  __s,
match_results< const _Ch_type *, _Alloc > &  __m,
const basic_regex< _Ch_type, _Rx_traits > &  __re,
regex_constants::match_flag_type  __f = regex_constants::match_default 
)
inline

Determines if there is a match between the regular expression e and a C-style null-terminated string.

Parameters
__sThe C-style null-terminated string to match.
__mThe match results.
__reThe regular expression.
__fControls how the regular expression is matched.
Return values
trueA match exists.
falseOtherwise.
Exceptions
anexception of type regex_error.

Definition at line 2025 of file regex.h.

References std::regex_match().

template<typename _Ch_traits , typename _Ch_alloc , typename _Alloc , typename _Ch_type , typename _Rx_traits >
bool std::regex_match ( const basic_string< _Ch_type, _Ch_traits, _Ch_alloc > &  __s,
match_results< typename basic_string< _Ch_type, _Ch_traits, _Ch_alloc >::const_iterator, _Alloc > &  __m,
const basic_regex< _Ch_type, _Rx_traits > &  __re,
regex_constants::match_flag_type  __flags = regex_constants::match_default 
)
inline

Determines if there is a match between the regular expression e and a string.

Parameters
__sThe string to match.
__mThe match results.
__reThe regular expression.
__flagsControls how the regular expression is matched.
Return values
trueA match exists.
falseOtherwise.
Exceptions
anexception of type regex_error.

Definition at line 2049 of file regex.h.

References std::basic_string< _CharT, _Traits, _Alloc >::begin(), std::basic_string< _CharT, _Traits, _Alloc >::end(), and std::regex_match().

template<typename _Ch_type , class _Rx_traits >
bool std::regex_match ( const _Ch_type *  __s,
const basic_regex< _Ch_type, _Rx_traits > &  __re,
regex_constants::match_flag_type  __f = regex_constants::match_default 
)
inline

Indicates if there is a match between the regular expression e and a C-style null-terminated string.

Parameters
__sThe C-style null-terminated string to match.
__reThe regular expression.
__fControls how the regular expression is matched.
Return values
trueA match exists.
falseOtherwise.
Exceptions
anexception of type regex_error.

Definition at line 2072 of file regex.h.

References std::regex_match().

template<typename _Ch_traits , typename _Str_allocator , typename _Ch_type , typename _Rx_traits >
bool std::regex_match ( const basic_string< _Ch_type, _Ch_traits, _Str_allocator > &  __s,
const basic_regex< _Ch_type, _Rx_traits > &  __re,
regex_constants::match_flag_type  __flags = regex_constants::match_default 
)
inline

Indicates if there is a match between the regular expression e and a string.

Parameters
__s[IN] The string to match.
__re[IN] The regular expression.
__flags[IN] Controls how the regular expression is matched.
Return values
trueA match exists.
falseOtherwise.
Exceptions
anexception of type regex_error.

Definition at line 2094 of file regex.h.

References std::basic_string< _CharT, _Traits, _Alloc >::begin(), std::basic_string< _CharT, _Traits, _Alloc >::end(), and std::regex_match().

template<typename _Out_iter , typename _Bi_iter , typename _Rx_traits , typename _Ch_type , typename _St , typename _Sa >
_Out_iter std::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 
)
inline

Search for a regular expression within a range for multiple times, and replace the matched parts through filling a format string.

Parameters
__out[OUT] The output iterator.
__first[IN] The start of the string to search.
__last[IN] One-past-the-end of the string to search.
__e[IN] The regular expression to search for.
__fmt[IN] The format string.
__flags[IN] Search and replace policy flags.
Returns
__out
Exceptions
anexception of type regex_error.

Definition at line 2251 of file regex.h.

References std::basic_string< _CharT, _Traits, _Alloc >::c_str().

Referenced by std::regex_replace().

template<typename _Out_iter , typename _Bi_iter , typename _Rx_traits , typename _Ch_type >
_Out_iter std::regex_replace ( _Out_iter  __out,
_Bi_iter  __first,
_Bi_iter  __last,
const basic_regex< _Ch_type, _Rx_traits > &  __e,
const _Ch_type *  __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 through filling a format C-string.

Parameters
__out[OUT] The output iterator.
__first[IN] The start of the string to search.
__last[IN] One-past-the-end of the string to search.
__e[IN] The regular expression to search for.
__fmt[IN] The format C-string.
__flags[IN] Search and replace policy flags.
Returns
__out
Exceptions
anexception of type regex_error.
template<typename _Rx_traits , typename _Ch_type , typename _St , typename _Sa , typename _Fst , typename _Fsa >
basic_string<_Ch_type, _St, _Sa> std::regex_replace ( const basic_string< _Ch_type, _St, _Sa > &  __s,
const basic_regex< _Ch_type, _Rx_traits > &  __e,
const basic_string< _Ch_type, _Fst, _Fsa > &  __fmt,
regex_constants::match_flag_type  __flags = regex_constants::match_default 
)
inline

Search for a regular expression within a string for multiple times, and replace the matched parts through filling a format string.

Parameters
__s[IN] The string to search and replace.
__e[IN] The regular expression to search for.
__fmt[IN] The format string.
__flags[IN] Search and replace policy flags.
Returns
The string after replacing.
Exceptions
anexception of type regex_error.

Definition at line 2296 of file regex.h.

References std::back_inserter(), std::basic_string< _CharT, _Traits, _Alloc >::begin(), std::basic_string< _CharT, _Traits, _Alloc >::end(), and std::regex_replace().

template<typename _Rx_traits , typename _Ch_type , typename _St , typename _Sa >
basic_string<_Ch_type, _St, _Sa> std::regex_replace ( const basic_string< _Ch_type, _St, _Sa > &  __s,
const basic_regex< _Ch_type, _Rx_traits > &  __e,
const _Ch_type *  __fmt,
regex_constants::match_flag_type  __flags = regex_constants::match_default 
)
inline

Search for a regular expression within a string for multiple times, and replace the matched parts through filling a format C-string.

Parameters
__s[IN] The string to search and replace.
__e[IN] The regular expression to search for.
__fmt[IN] The format C-string.
__flags[IN] Search and replace policy flags.
Returns
The string after replacing.
Exceptions
anexception of type regex_error.

Definition at line 2322 of file regex.h.

References std::back_inserter(), std::basic_string< _CharT, _Traits, _Alloc >::begin(), std::basic_string< _CharT, _Traits, _Alloc >::end(), and std::regex_replace().

template<typename _Rx_traits , typename _Ch_type , typename _St , typename _Sa >
basic_string<_Ch_type> std::regex_replace ( const _Ch_type *  __s,
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 
)
inline

Search for a regular expression within a C-string for multiple times, and replace the matched parts through filling a format string.

Parameters
__s[IN] The C-string to search and replace.
__e[IN] The regular expression to search for.
__fmt[IN] The format string.
__flags[IN] Search and replace policy flags.
Returns
The string after replacing.
Exceptions
anexception of type regex_error.

Definition at line 2348 of file regex.h.

References std::back_inserter(), and std::regex_replace().

template<typename _Rx_traits , typename _Ch_type >
basic_string<_Ch_type> std::regex_replace ( const _Ch_type *  __s,
const basic_regex< _Ch_type, _Rx_traits > &  __e,
const _Ch_type *  __fmt,
regex_constants::match_flag_type  __flags = regex_constants::match_default 
)
inline

Search for a regular expression within a C-string for multiple times, and replace the matched parts through filling a format C-string.

Parameters
__s[IN] The C-string to search and replace.
__e[IN] The regular expression to search for.
__fmt[IN] The format C-string.
__flags[IN] Search and replace policy flags.
Returns
The string after replacing.
Exceptions
anexception of type regex_error.

Definition at line 2374 of file regex.h.

References std::back_inserter(), and std::regex_replace().

template<typename _Bi_iter , typename _Alloc , typename _Ch_type , typename _Rx_traits >
bool std::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 
)
inline

Searches for a regular expression within a range.

Parameters
__s[IN] The start of the string to search.
__e[IN] One-past-the-end of the string to search.
__m[OUT] The match results.
__re[IN] The regular expression to search for.
__flags[IN] Search policy flags.
Return values
trueA match was found within the string.
falseNo match was found within the string, the content of m is undefined.
Exceptions
anexception of type regex_error.

Definition at line 2117 of file regex.h.

Referenced by std::regex_iterator< _Bi_iter, _Ch_type, _Rx_traits >::regex_iterator(), and std::regex_search().

template<typename _Bi_iter , typename _Ch_type , typename _Rx_traits >
bool std::regex_search ( _Bi_iter  __first,
_Bi_iter  __last,
const basic_regex< _Ch_type, _Rx_traits > &  __re,
regex_constants::match_flag_type  __flags = regex_constants::match_default 
)
inline

Searches for a regular expression within a range.

Parameters
__first[IN] The start of the string to search.
__last[IN] One-past-the-end of the string to search.
__re[IN] The regular expression to search for.
__flags[IN] Search policy flags.
Return values
trueA match was found within the string.
falseNo match was found within the string.
Exceptions
anexception of type regex_error.

Definition at line 2141 of file regex.h.

References std::regex_search().

template<typename _Ch_type , class _Alloc , class _Rx_traits >
bool std::regex_search ( const _Ch_type *  __s,
match_results< const _Ch_type *, _Alloc > &  __m,
const basic_regex< _Ch_type, _Rx_traits > &  __e,
regex_constants::match_flag_type  __f = regex_constants::match_default 
)
inline

Searches for a regular expression within a C-string.

Parameters
__s[IN] A C-string to search for the regex.
__m[OUT] The set of regex matches.
__e[IN] The regex to search for in s.
__f[IN] The search flags.
Return values
trueA match was found within the string.
falseNo match was found within the string, the content of m is undefined.
Exceptions
anexception of type regex_error.

Definition at line 2164 of file regex.h.

References std::regex_search().

template<typename _Ch_type , typename _Rx_traits >
bool std::regex_search ( const _Ch_type *  __s,
const basic_regex< _Ch_type, _Rx_traits > &  __e,
regex_constants::match_flag_type  __f = regex_constants::match_default 
)
inline

Searches for a regular expression within a C-string.

Parameters
__s[IN] The C-string to search.
__e[IN] The regular expression to search for.
__f[IN] Search policy flags.
Return values
trueA match was found within the string.
falseNo match was found within the string.
Exceptions
anexception of type regex_error.

Definition at line 2183 of file regex.h.

References std::regex_search().

template<typename _Ch_traits , typename _String_allocator , typename _Ch_type , typename _Rx_traits >
bool std::regex_search ( const basic_string< _Ch_type, _Ch_traits, _String_allocator > &  __s,
const basic_regex< _Ch_type, _Rx_traits > &  __e,
regex_constants::match_flag_type  __flags = regex_constants::match_default 
)
inline

Searches for a regular expression within a string.

Parameters
__s[IN] The string to search.
__e[IN] The regular expression to search for.
__flags[IN] Search policy flags.
Return values
trueA match was found within the string.
falseNo match was found within the string.
Exceptions
anexception of type regex_error.

Definition at line 2202 of file regex.h.

References std::regex_search().

template<typename _Ch_traits , typename _Ch_alloc , typename _Alloc , typename _Ch_type , typename _Rx_traits >
bool std::regex_search ( const basic_string< _Ch_type, _Ch_traits, _Ch_alloc > &  __s,
match_results< typename basic_string< _Ch_type, _Ch_traits, _Ch_alloc >::const_iterator, _Alloc > &  __m,
const basic_regex< _Ch_type, _Rx_traits > &  __e,
regex_constants::match_flag_type  __f = regex_constants::match_default 
)
inline

Searches for a regular expression within a string.

Parameters
__s[IN] A C++ string to search for the regex.
__m[OUT] The set of regex matches.
__e[IN] The regex to search for in s.
__f[IN] The search flags.
Return values
trueA match was found within the string.
falseNo match was found within the string, the content of m is undefined.
Exceptions
anexception of type regex_error.

Definition at line 2225 of file regex.h.

References std::basic_string< _CharT, _Traits, _Alloc >::begin(), std::basic_string< _CharT, _Traits, _Alloc >::end(), and std::regex_search().

template<typename _Ch_type , typename _Rx_traits >
void std::swap ( basic_regex< _Ch_type, _Rx_traits > &  __lhs,
basic_regex< _Ch_type, _Rx_traits > &  __rhs 
)
inline

Swaps the contents of two regular expression objects.

Parameters
__lhsFirst regular expression.
__rhsSecond regular expression.

Definition at line 816 of file regex.h.

template<typename _Bi_iter , typename _Alloc >
void std::swap ( match_results< _Bi_iter, _Alloc > &  __lhs,
match_results< _Bi_iter, _Alloc > &  __rhs 
)
inline

Swaps two match results.

Parameters
__lhsA match result.
__rhsA match result.

The contents of the two match_results objects are swapped.

Definition at line 1944 of file regex.h.