std::basic_regex::basic_regex

From Cppreference

Jump to: navigation, search
basic_regex();
(1) (C++11 feature)
explicit basic_regex( const CharT* p,
                      flag_type f = std::regex_constants::ECMAScript );
(2) (C++11 feature)
basic_regex( const CharT* p, size_t len, flag_type f );
(3) (C++11 feature)
basic_regex( const basic_regex& rhs );
(4) (C++11 feature)
basic_regex( const basic_regex&& rhs );
(5) (C++11 feature)
template< class ST, class SA >

explicit basic_regex( const std::basic_string<CharT,ST,SA>& s,

                      flag_type f = std::regex_constants::ECMAScript );
(6) (C++11 feature)
template< class ForwardIterator >

basic_regex( ForwardIterator first, ForwardIterator last,

             flag_type f = std::regex_constants::ECMAScript );
(7) (C++11 feature)
basic_regex( std::initializer_list<CharT> init,
             flag_type f = std::regex_constants::ECMAScript );
(8) (C++11 feature)

Constructs a new regex from a sequence of characters interpreted according to the flags.

1) Default constructor. Constructs an empty regular expression which will match nothing.

2) Constructs a regex from a null-terminated (C-string style) sequence of characters.

3) Constructs a regex from a counted sequence of characters.

4) Copy constructor. Constructs a regex by copying rhs

5) Move constructor. Constructs a regex by with the contents of rhs using move semantics.

6) Constructs a regex from a basic_string.

7) Range constructor. Constructs the string with the contents of the range [first, last).

8) Initializer list constructor. Constructs the string with the contents of the initializer list init.

[edit] Parameters

p - pointer to a character sequence use to initialize the regex
len - length of a character sequence used to initialize the regex
first, last - range of a character sequence used to initialize the regex
s - a basic_string used as a source used to initialize the regex
rhs - another regex to use as source to initialize the regex
init - initializer list used to initialize the regex
f - flags used to guide the interpretation of the character sequence as a regular expression