std::basic_regex<CharT,Traits>::assign
來自 cppreference.com
< cpp | regex | basic_regex
basic_regex& assign( const basic_regex& other ); |
(1) | (C++11 起) |
basic_regex& assign( basic_regex&& other ) noexcept; |
(2) | (C++11 起) |
basic_regex& assign( const CharT* s, flag_type f = std::regex_constants::ECMAScript ); |
(3) | (C++11 起) |
basic_regex& assign( const CharT* ptr, std::size_t count, flag_type f = std::regex_constants::ECMAScript ); |
(4) | (C++11 起) |
template< class ST, class SA > basic_regex& assign( const std::basic_string<CharT,ST,SA>& str, |
(5) | (C++11 起) |
template< class InputIt > basic_regex& assign( InputIt first, InputIt last, |
(6) | (C++11 起) |
basic_regex& assign( std::initializer_list<CharT> ilist, flag_type f = std::regex_constants::ECMAScript ); |
(7) | (C++11 起) |
將內容賦值給正則表示式。
2) 使用移動語義賦值 other 的內容。flags() 和 mark_count() 在賦值前與 other.flags() 和 other.mark_count() 的值相等。呼叫後,other 處於一個有效但未指定的狀態。
3) 賦值由 s 指向的以 null 結尾的字串。
4) 賦值由 s 指向的 count 個字元的序列。
5) 賦值字串 str。
6) 賦值範圍
[
first,
last)
中的字元。7) 賦值初始化列表 ilist 中的字元。
目錄 |
[編輯] 引數
其他 | - | 要賦值的另一個正則表示式 |
s | - | 指向要賦值的字元序列的指標 |
str | - | 要賦值的字串 |
first, last | - | 要賦值的字元範圍 |
ilist | - | 包含要賦值字元的初始化列表 |
型別要求 | ||
-InputIt 必須滿足 LegacyInputIterator 的要求。 |
[編輯] 返回值
*this
[編輯] 異常
1) 可能會丟擲實現定義的異常。
3-7) 如果提供的正則表示式無效,則丟擲 std::regex_error。在這種情況下,物件不會被修改。
[編輯] 示例
本節不完整 原因:無示例 |
[編輯] 參閱
賦值內容 (public member function) |