std::regex_token_iterator::regex_token_iterator
STD::regex[医]令牌[医]迭代器::regex[医]令牌[医]迭代器
regex_token_iterator( | (1) | (since 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) | (since 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) | (since 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) | (since 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) | (since C++11) |
regex_token_iterator( const regex_token_iterator& other | (6) | (since 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) | (since 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) | (since 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) | (since 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) | (since C++14) |
构造一个新的regex_token_iterator
*
1%29默认构造函数。构造序列结束迭代器。
2-5%29首先,将所请求的子匹配的列表从submatches
或submatch
参数存储在迭代器中的成员列表中,并构造成员。std::regex_iterator
通过a
,,,b
,,,re
,和m
对于其四个参数构造函数%28,该构造函数执行对std::regex_search
%29并将子匹配的内部计数器设置为零。
- 如果,在建造后,成员
regex_iterator
不是序列结束迭代器,而是设置指向当前地址的成员指针。std::sub_match
...
- 否则,%28如果成员
regex_iterator
是序列结束迭代器%29,但是值-1
中的值之一。submatches
/submatch
转*this
变成后缀迭代器
指向射程[a,b)
%28整个字符串是不匹配的后缀%29。
- 否则,%28 if-1不在子匹配%29的列表中,将
*this
进入序列结束迭代器。
中的任何值时,该行为都是未定义的。submatches
小于-1
...
6%29复制构造函数:执行按成员顺序复制%28,包括创建成员的副本regex_iterator
和指向当前的成员指针。sub_match
29%。
7-10%29禁止使用临时正则表达式调用重载2-5,否则返回的迭代器将立即失效。
参数
a | - | BidirectionalIterator to the beginning of the target character sequence |
---|---|---|
b | - | BidirectionalIterator to the end of the target character sequence |
re | - | regular expression used to search the target character sequence |
submatch | - | the index of the submatch that should be returned. "0" represents the entire match, and "-1" represents the parts that are not matched (e.g, the stuff between matches). |
submatches | - | the sequence of submatch indices that should be iterated over within each match, may include the special value -1 for the non-matched fragments |
m | - | flags that govern the behavior of re |
例
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
http://en.cppreference.com/w/cpp/regex/regex[医]令牌[医]迭代器/正则表达式[医]令牌[医]迭代器