名前空間
変種

std::regex_token_iterator<BidirIt,CharT,Traits>::regex_token_iterator

提供: cppreference.com
<tbody> </tbody>
regex_token_iterator();
(1) (C++11以上)
regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, int submatch = 0, std::regex_constants::match_flag_type m = std::regex_constants::match_default );
(2) (C++11以上)
regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, const std::vector<int>& submatches, std::regex_constants::match_flag_type m = std::regex_constants::match_default );
(3) (C++11以上)
regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, std::initializer_list<int> submatches, std::regex_constants::match_flag_type m = std::regex_constants::match_default );
(4) (C++11以上)
template <std::size_t N> regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, const int (&submatches)[N], std::regex_constants::match_flag_type m = std::regex_constants::match_default );
(5) (C++11以上)
regex_token_iterator( const regex_token_iterator& other );
(6) (C++11以上)
regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b, const regex_type&& re, int submatch = 0, std::regex_constants::match_flag_type m = std::regex_constants::match_default ) = delete;
(7) (C++14以上)
regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b, const regex_type&& re, const std::vector<int>& submatches, std::regex_constants::match_flag_type m = std::regex_constants::match_default ) = delete;
(8) (C++14以上)
regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b, const regex_type&& re, std::initializer_list<int> submatches, std::regex_constants::match_flag_type m = std::regex_constants::match_default ) = delete;
(9) (C++14以上)
template <std::size_t N> regex_token_iterator( BidirectionalIterator a, BidirectionalIterator b, const regex_type&& re, const int (&submatches)[N], std::regex_constants::match_flag_type m = std::regex_constants::match_default ) = delete;
(10) (C++14以上)

新しい regex_token_iterator を構築します。

1) デフォルトコンストラクタ。 終端イテレータを構築します。
2-5) まず、 submatches または submatch 引数からイテレータ内のメンバ list に要求される部分マッチのリストをコピーし、 abre および m を4引数のコンストラクタに渡すことによってメンバの std::regex_iterator を構築し (このコンストラクタは std::regex_search の最初の呼び出しを行います)、部分マッチの内部カウンタをゼロに設定します。
  • 構築後、メンバの regex_iterator が終端イテレータでなければ、メンバのポインタを現在の std::sub_match のアドレスに設定します。
  • そうでなく (メンバの regex_iterator が終端イテレータであり)、 submatches/submatch 内の値のいずれかが -1 であれば、*this を 範囲 [a,b) を指す接尾辞イテレータにします (文字列全体がマッチしなかった接尾辞です)。
  • そうでなければ (-1 が部分マッチのリストになければ)、 *this を終端イテレータにします。

submatches 内の値のいずれかが -1 より小さい場合、動作は未定義です。

6) コピーコンストラクタ。 メンバ単位のコピーを行います (メンバの regex_iterator および現在の {{lc|sub_match} を指すポインタのコピーを行うことも含みます)。
7-10) オーバーロード 2-5 に一時的な regex を渡せないようにします。 返されたイテレータが直ちに無効になるためです。

引数

a - ターゲット文字シーケンスの先頭を指す LegacyBidirectionalIterator
b - ターゲット文字シーケンスの終端を指す LegacyBidirectionalIterator
re - ターゲット文字シーケンスを検索するために使用される正規表現
submatch - 返すべき部分マッチのインデックス。 「0」はマッチ全体を表し、「-1」はマッチしなかった部分 (マッチとマッチの間の部分) を表します
submatches - それぞれのマッチ内でイテレートするべき部分マッチのインデックス列。 マッチしなかった部分を表す特別な値 -1 を含んでも構いません
m - re の動作に影響を与えるフラグ