子迭代器的类。
template<class BidIt, class Elem = iterator_traits<BidIt>::value_type,
class RXtraits = regex_traits<Elem> >
class regex_token_iterator {
public:
typedef basic_regex<Elem, RXtraits> regex_type;
typedef sub_match<BidIt> value_type;
typedef std::forward_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;
typedef const sub_match<BidIt> *pointer;
typedef const sub_match<BidIt>& reference;
regex_token_iterator();
regex_token_iterator(BidIt first, BidIt last,
const regex_type& re, int submatch = 0,
regex_constants::match_flag_type f = regex_constants::match_default);
regex_token_iterator(BidIt first, BidIt last,
const regex_type& re, const std::vector<int> submatches,
regex_constants::match_flag_type f = regex_constants::match_default);
template<std::size_t N>
regex_token_iterator(BidIt first, BidIt last,
const regex_type& re, const int (&submatches)[N],
regex_constants::match_flag_type f = regex_constants::match_default);
bool operator==(const regex_token_iterator& right);
bool operator!=(const regex_token_iterator& right);
const basic_string<Elem>& operator*();
const basic_string<Elem> *operator->();
regex_token_iterator& operator++();
regex_token_iterator& operator++(int);
private:
regex_iterator<BidIt, Elem, RXtraits> it; // exposition only
vector<int> subs; // exposition only
int pos; // exposition only
};
参数
BidIt
子迭代器的类型。Elem
元素类型与匹配。RXtraits
元素的字符类。
备注
模板类描述常数的前向迭代器对象。 从概念上讲,它保留它使用为字符序列的正则表达式匹配搜索的 regex_iterator 对象。 它获取表示类型的 sub_match<BidIt> 子对象由存储在 subs 的每个索引的矢量正则表达式匹配项的。
索引 -1 处字符序列的开头指定在前面正则表达式匹配之后结尾的字符序列开始或开头,则以前正则表达式匹配和扩展到,但不包括当前正则表达式匹配项的第一个字符,或对字符序列的末尾,则没有当前匹配。 其他索引值 idx 指定 it.match[idx]中容纳的捕获组的内容。
要求
标头: <regex>
命名空间: std