std::basic_regex::assign(3)
β¨ NAME β¨
std::basic_regex::assign β std::basic_regex::assign. From the C++ Standard Libary, this is the assignment glow-up for regular expressions. Page std::basic_regex::assign(3), bestie. π
π§ Synopsis π§
Okay so here's the overload lineup, and every single one is since C++11:
(1) (since C++11)
basic_regex& assign( const basic_regex& other );
(2) (since C++11)
basic_regex& assign( basic_regex&& other ) noexcept;
(3) (since C++11)
basic_regex& assign( const CharT* s,
flag_type f =
std::regex_constants::ECMAScript );
(4) (since C++11)
basic_regex& assign( const CharT* ptr, std::size_t count,
flag_type f =
std::regex_constants::ECMAScript );
(5) (since C++11)
template< class ST, class SA >
basic_regex& assign( const std::basic_string<CharT,ST,SA>& str,
flag_type f =
std::regex_constants::ECMAScript );
(6) (since C++11)
template< class InputIt >
basic_regex& assign( InputIt first, InputIt last,
flag_type f =
std::regex_constants::ECMAScript );
(7) (since C++11)
basic_regex& assign( std::initializer_list<CharT> ilist,
flag_type f =
std::regex_constants::ECMAScript );
So like, assign assigns the contents to the regular expression. That's the whole main-character job. β¨
- Assigns the contents of
other. After the call,flags()andmark_count()are equivalent to the values ofother.flags()andother.mark_count(). - Assigns the contents of
otherusing move semantics.flags()andmark_count()are equivalent to the values ofother.flags()andother.mark_count()before the assignment. After the call,otheris in a valid, but unspecified state. π«Ά
3-7) β Assigns a sequence of characters to the regular expression. The syntax flags are set to f. mark_count() returns the number of marked subexpressions within the resulting subexpression after the call.
3)β Assigns a null-terminated string pointed to bys.4)β Assigns a sequence ofcountcharacters, pointed to bys.5)β Assigns the stringstr.6)β Assigns the characters in the range[first, last).7)β Assigns the characters in the initializer listilist.
π Parameters π
otherβ another regular expression to assignsβ pointer to a character sequence to assignstrβ string to assignfirst, lastβ the range of characters to assignilistβ initializer list containing characters to assign
πΈ Type requirements πΈ
InputItmust meet the requirements ofLegacyInputIterator.
π₯ Return value π₯
*this
π Exceptions π
1)β May throw implementation-defined exceptions.3-7)βstd::regex_errorif the supplied regular expression is not valid. The object is not modified in that case.
π Example π
This section is incomplete.
Reason: no example.
π See also π
operator=β assigns the contents (public member function)
π Category π
* Todo no example
Okay that's the whole page, bestie β source http://cppreference.com, version/date 2024.06.10, page std::basic_regex::assign(3). πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms