Learning boost 6--Regex 1[11]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 heroboy2000 的 blog

还有就是一大堆的比较操作符的重载了,这里就不多说了。

 

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;

声明很简单,有四个特化可以直接使用,不过要注意stringchar*字符串使用的match_results是不同的。

成员函数:

m.size()

容量。

m.max_size()

最大容量。

m.empty()

容量是否为0

m[n]

n个元素,即sub_match

m.prefix()

本文关键:Learning boost 6--Regex 1
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top