Namespaces
Variants
Views
Actions

std::basic_regex

From cppreference.com
< cpp‎ | regex
Revision as of 13:52, 2 November 2012 by P12bot (Talk | contribs)

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

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

Member functions

Template:cpp/regex/basic regex/dcl list constructorTemplate:cpp/regex/basic regex/dcl list destructorTemplate:cpp/regex/basic regex/dcl list operator=Template:cpp/regex/basic regex/dcl list assignTemplate:cpp/regex/basic regex/dcl list mark countTemplate:cpp/regex/basic regex/dcl list flagsTemplate:cpp/regex/basic regex/dcl list getlocTemplate:cpp/regex/basic regex/dcl list imbueTemplate:cpp/regex/basic regex/dcl list swap
Observers
Locale
Modifiers

Constants

Value Effect(s)
icase ignores case when matching characters
nosubs does not store sub-expression matches
optimize faster matching, slower construction
collate makes range expressions locale-sensitive
ECMAScript uses an ECMA-262 (Perl 5) syntax
basic uses a POSIX basic regular expression syntax
extended uses a POSIX extended regular expression syntax
awk uses an awk-compatible syntax
grep uses a grep-compatible syntax
egrep uses an extended grep-compatible syntax

Non-member functions

Template:cpp/regex/basic regex/dcl list swap2