Namespaces
Variants
Views
Actions

std::basic_regex::assign

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

Template:ddcl list begin <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
basic_regex& assign( const basic_regex& other );
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
basic_regex& assign( basic_regex&& that );
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
basic_regex& assign( const CharT* s,
                     flag_type f = std::regex_constants::ECMAScript );
</td>

<td > (3) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
basic_regex& assign( const charT* ptr, size_t count,
                     flag_type f = regex_constants::ECMAScript );
</td>

<td > (4) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
template< class ST, class SA >

basic_regex& assign( const std::basic_string<CharT,ST,SA>& str,

                     flag_type f = std::regex_constants::ECMAScript );
</td>

<td > (5) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
template< class InputIt >

basic_regex& assign( InputIt first, InputIt last,

                     flag_type f = std::regex_constants::ECMAScript );
</td>

<td > (6) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
basic_regex& assign( std::initializer_list<CharT> ilist,
                     flag_type f = std::regex_constants::ECMAScript );
</td>

<td > (7) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

Assigns the contents to the regular expression.

1) Assigns the contents of other. Template:rlpf and Template:rlpf are equivalent to the values of other.flags() and other.mark_count() after the call.
2) Assigns the contents of other using move semantics. Template:rlpf and Template:rlpf are equivalent to the values of other.flags() and other.mark_count() before the assignment. After the call, other is in a valid, but unspecified state.
3-7) Assigns a sequence of characters to the regular expression. The syntax flags are set to f. Template:rlpf returns the number of marked subexpressions within the resulting subexpression after the call.
3) Assigns a null-terminated string pointed to by s.
4) Assigns a sequence of count characters, pointed to by s.
5) Assigns the string str.
6) Assigns the characters in the range [first, last).
7) Assigns the characters in the initializer list ilist.

Contents

Parameters

other - another regular expression to assign
s - pointer to a character sequence to assign
str - string to assign
first, last - the range of characters to assign
ilist - initializer list containing characters to assign
Type requirements
-
InputIt must meet the requirements of InputIterator.

Return value

*this

Exceptions

1) (none)
2)
noexcept specification:  
noexcept
  
3-7) std::regex_error if the supplied regular expression is not valid. The object is not modified in that case.

Example

See also

Template:cpp/regex/basic regex/dcl list operator=