Namespaces
Variants
Views
Actions

std::basic_regex

From cppreference.com
Defined in header <regex>
template <

    class CharT = char,
    class Traits = std::regex_traits<CharT>

> class basic_regex;
(since C++11)

The class template basic_regex provides a general framework for holding regular expressions.

Several specializations for common character types are provided:

Defined in header <regex>
Type Definition
regex basic_regex<char>
wregex basic_regex<wchar_t>

Contents

[edit] Member types

Member type Definition
value_type CharT
traits_type Traits
string_type Traits::string_type
locale_type Traits::locale_type
flag_type std::regex_constants::syntax_option_type

[edit] Member functions

constructs the regex object
(public member function) [edit]
destructs the regex object
(public member function) [edit]
assigns the contents
(public member function) [edit]
assigns the contents
(public member function) [edit]
Observers
returns the number of marked sub-expressions within the regular expression
(public member function) [edit]
returns the syntax flags
(public member function) [edit]
Locale
get locale information
(public member function) [edit]
set locale information
(public member function) [edit]
Modifiers
swaps the contents
(public member function) [edit]

Constants

Value Effect(s)
icase ignore case
nosubs don't store sub-expression matches
optimize faster matching, slower construction
collate make alphabetic characters local-sensitive
ECMAScript use an ECMA-262 regex engine
basic use a basic POSIX regex engine
extended use an extended POSIX regex engine
awk use an awk-compatible regex engine
grep use a "grep"-compatible regex engine
egrep use an "extended grep"-compatible regex engine

[edit] Non-member functions

specializes the std::swap algorithm
(function template) [edit]