std::basic_regex<CharT,Traits>::assign
提供: cppreference.com
<tbody>
</tbody>
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, 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, flag_type f = std::regex_constants::ECMAScript ); |
(5) | (C++11以上) |
template< class InputIt > basic_regex& assign( InputIt first, InputIt last, flag_type f = std::regex_constants::ECMAScript ); |
(6) | (C++11以上) |
basic_regex& assign( std::initializer_list<CharT> ilist, flag_type f = std::regex_constants::ECMAScript ); |
(7) | (C++11以上) |
内容を正規表現に代入します。
1)
other の内容を代入します。 呼び出し後 flags() および mark_count() は other.flags() および other.mark_count() の値と同等になります。2) ムーブセマンティクスを用いて
other の内容を代入します。 flags() および mark_count() は代入前の other.flags() および other.mark_count() の値と同等になります。 呼び出し後 other は有効だけれども未規定な状態になります。3-7) 文字シーケンスを正規表現に代入します。 構文フラグは
f に設定されます。 mark_count() は呼び出し後の結果の部分表現内のマーク付き部分表現の数を返します。3)
s の指すヌル終端文字列を代入します。4)
s の指す長さ count の文字シーケンスを代入します。5) 文字列
str を代入します。6) 範囲
[first, last) 内の文字を代入します。7) 初期化子リスト
ilist 内の文字を代入します。引数
| other | - | 代入する別の正規表現 |
| s | - | 代入する文字シーケンスを指すポインタ |
| str | - | 代入する文字列 |
| first, last | - | 代入する文字の範囲 |
| ilist | - | 代入する文字を持つ初期化子リスト |
| 型の要件 | ||
-InputIt は LegacyInputIterator の要件を満たさなければなりません。
| ||
戻り値
*this。
例外
1-2) (なし)
3-7) 供給された正規表現が有効でなければ std::regex_error。 その場合、オブジェクトは変更されません。
例
| This section is incomplete Reason: no example |
関連項目
| 内容を代入します (パブリックメンバ関数) |