Namespaces
Variants

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

From cppreference.net
Regular expressions library
Classes
(C++11)
Algorithms
Iterators
Exceptions
Traits
Constants
(C++11)
Regex Grammar
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 によって指されるnull終端文字列を割り当てます。
4) s が指す count 個の文字シーケンスを割り当てる。
5) 文字列 str を割り当てます。
6) 範囲 [ first , last ) 内の文字を割り当てます。
7) 初期化子リスト ilist 内の文字を割り当てます。

目次

パラメータ

other - 割り当てる別の正規表現
s - 割り当てる文字シーケンスへのポインタ
str - 割り当てる文字列
first, last - 割り当てる文字の範囲
ilist - 割り当てる文字を含む初期化子リスト
型要件
-
InputIt LegacyInputIterator の要件を満たさなければならない。

戻り値

* this

例外

1) 実装定義の例外をスローする可能性があります。
3-7) std::regex_error 指定された正規表現が有効でない場合。その場合、オブジェクトは変更されません。

関連項目

内容を代入する
(公開メンバ関数)