31 Regular expressions library [re]

31.8 Class template basic_­regex [re.regex]

31.8.3 basic_­regex assign [re.regex.assign]

basic_regex& operator=(const basic_regex& e);
Effects: Copies e into *this and returns *this.
Postconditions: flags() and mark_­count() return e.flags() and e.mark_­count(), respectively.
basic_regex& operator=(basic_regex&& e) noexcept;
Effects: Move assigns from e into *this and returns *this.
Postconditions: flags() and mark_­count() return the values that e.flags() and e.mark_­count(), respectively, had before assignment.
e is in a valid state with unspecified value.
basic_regex& operator=(const charT* ptr);
Requires: ptr shall not be a null pointer.
Effects: Returns assign(ptr).
basic_regex& operator=(initializer_list<charT> il);
Effects: Returns assign(il.begin(), il.end()).
template <class ST, class SA> basic_regex& operator=(const basic_string<charT, ST, SA>& p);
Effects: Returns assign(p).
basic_regex& assign(const basic_regex& that);
Effects: Equivalent to *this = that.
Returns: *this.
basic_regex& assign(basic_regex&& that) noexcept;
Effects: Equivalent to *this = std​::​move(that).
Returns: *this.
basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);
Returns: assign(string_­type(ptr), f).
basic_regex& assign(const charT* ptr, size_t len, flag_type f = regex_constants::ECMAScript);
Returns: assign(string_­type(ptr, len), f).
template <class string_traits, class A> basic_regex& assign(const basic_string<charT, string_traits, A>& s, flag_type f = regex_constants::ECMAScript);
Throws: regex_­error if s is not a valid regular expression.
Returns: *this.
Effects: Assigns the regular expression contained in the string s, interpreted according the flags specified in f.
If an exception is thrown, *this is unchanged.
Postconditions: If no exception is thrown, flags() returns f and mark_­count() returns the number of marked sub-expressions within the expression.
template <class InputIterator> basic_regex& assign(InputIterator first, InputIterator last, flag_type f = regex_constants::ECMAScript);
Requires: The type InputIterator shall satisfy the requirements for an Input Iterator ([input.iterators]).
Returns: assign(string_­type(first, last), f).
basic_regex& assign(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
Effects: Same as assign(il.begin(), il.end(), f).
Returns: *this.