名前空間
変種
操作

std::basic_regex<CharT,Traits>::assign

From cppreference.com
< cpp‎ | regex‎ | basic regex
 
 
 
正規表現ライブラリ
クラス
(C++11)
アルゴリズム
イテレータ
例外
Traits
定数
(C++11)
正規表現文法
 
 
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,

                     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) 範囲 [firstlast) の文字を代入します。
7) 初期化子リスト ilist の文字を代入します。

目次

[編集] Parameters

その他 - 代入する別の正規表現
s - 代入する文字シーケンスへのポインタ
str - 代入する文字列
first, last - 代入する文字の範囲
ilist - 代入する文字を含む初期化子リスト
型要件
-
InputItLegacyInputIterator の要件を満たす必要があります。

[編集] Return value

*this

[編集] Exceptions

1) 実装定義の例外を投げる可能性がある。
3-7) 提供された正規表現が無効な場合、std::regex_error。この場合、オブジェクトは変更されません。

[編集] Example

[編集] See also

内容を代入する
(public member function) [編集]
English 日本語 中文(简体) 中文(繁體)