Files
2025-10-25 03:02:53 +03:00

170 lines
4.7 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[re.regex.assign]
# 28 Text processing library [[text]](./#text)
## 28.6 Regular expressions library [[re]](re#regex.assign)
### 28.6.7 Class template basic_regex [[re.regex]](re.regex#assign)
#### 28.6.7.3 Assignment [re.regex.assign]
[🔗](#lib:basic_regex,operator=)
`basic_regex& operator=(const basic_regex& e);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10584)
*Postconditions*: flags() and mark_count() returne.flags() and e.mark_count(), respectively[.](#1.sentence-1)
[🔗](#lib:basic_regex,operator=_)
`basic_regex& operator=(basic_regex&& e) noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10596)
*Postconditions*: flags() and mark_count() return the values thate.flags() and e.mark_count(), respectively, had before assignment[.](#2.sentence-1)
e is in a valid state with unspecified value[.](#2.sentence-2)
[🔗](#lib:basic_regex,operator=__)
`basic_regex& operator=(const charT* p);
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10609)
*Effects*: Equivalent to: return assign(p);
[🔗](#lib:basic_regex,operator=___)
`basic_regex& operator=(initializer_list<charT> il);
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10620)
*Effects*: Equivalent to: return assign(il.begin(), il.end());
[🔗](#lib:basic_regex,operator=____)
`template<class ST, class SA>
basic_regex& operator=(const basic_string<charT, ST, SA>& s);
`
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10632)
*Effects*: Equivalent to: return assign(s);
[🔗](#lib:basic_regex,assign)
`basic_regex& assign(const basic_regex& e);
`
[6](#6)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10643)
*Effects*: Equivalent to: return *this = e;
[🔗](#lib:basic_regex,assign_)
`basic_regex& assign(basic_regex&& e) noexcept;
`
[7](#7)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10654)
*Effects*: Equivalent to: return *this = std::move(e);
[🔗](#lib:basic_regex,assign__)
`basic_regex& assign(const charT* p, flag_type f = regex_constants::ECMAScript);
`
[8](#8)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10665)
*Effects*: Equivalent to: return assign(string_type(p), f);
[🔗](#lib:basic_regex,assign___)
`basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
`
[9](#9)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10676)
*Effects*: Equivalent to: return assign(string_type(p, len), f);
[🔗](#lib:basic_regex,assign____)
`template<class ST, class SA>
basic_regex& assign(const basic_string<charT, ST, SA>& s,
flag_type f = regex_constants::ECMAScript);
`
[10](#10)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10689)
*Effects*: Assigns the regular expression contained in the strings, interpreted according the flags specified in f[.](#10.sentence-1)
If an exception is thrown, *this is unchanged[.](#10.sentence-2)
[11](#11)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10695)
*Postconditions*: If no exception is thrown,flags() returns f and mark_count() returns the number of marked sub-expressions within the expression[.](#11.sentence-1)
[12](#12)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10701)
*Returns*: *this[.](#12.sentence-1)
[13](#13)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10705)
*Throws*: regex_error if s is not a valid regular expression[.](#13.sentence-1)
[🔗](#lib:basic_regex,assign_____)
`template<class InputIterator>
basic_regex& assign(InputIterator first, InputIterator last,
flag_type f = regex_constants::ECMAScript);
`
[14](#14)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10718)
*Effects*: Equivalent to: return assign(string_type(first, last), f);
[🔗](#lib:assign,basic_regex______)
`basic_regex& assign(initializer_list<charT> il,
flag_type f = regex_constants::ECMAScript);
`
[15](#15)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10730)
*Effects*: Equivalent to: return assign(il.begin(), il.end(), f);