还有就是一大堆的比较操作符的重载了,这里就不多说了。
l match_results
match_results相当于sub_match的容器,用于表示正则式算法的返回结果。
template <class bidirectionaliterator,
class allocator = allocator<sub_match<bidirectionaliterator> >
class match_results;
typedef match_results<const char*> cmatch;
typedef match_results<const wchar_t*> wcmatch;
typedef match_results<string::const_iterator> smatch;
typedef match_results<wstring::const_iterator> wsmatch;
声明很简单,有四个特化可以直接使用,不过要注意string和char*字符串使用的match_results是不同的。
成员函数:
|
m.size() |
容量。 |
|
m.max_size() |
最大容量。 |
|
m.empty() |
容量是否为0。 |
|
m[n] |
第n个元素,即sub_match |
|
m.prefix()
本文关键:Learning boost 6--Regex 1
相关方案
|