Regular Expressions
2017-02-09 本文已影响0人
龙遁流
<regex>
1,regex类,设置匹配模式pattern
2,regex_match,regex_search匹配字符串,返回bool类型表征是否匹配到
3,smatch类string,存储匹配的详细信息;cmatch类(const char*);wsmatch类(wstring),wcmatch(const wchar_t*)
match的结果的结构

1,m[0]匹配的match_results
2,prefix()和suffix()分别是匹配元素的前后部分
3,m[1],m[2],m[3]匹配到的元素的子元素
match_results<>类的定义
typedef match_results<string::const_iterator> smatch;
typedef match_results<wstring::const_iterator> wsmatch;
typedef match_results<const char*> cmatch;
typedef match_results<const wchar_t*> wcmatch;





