博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
boost::regex
阅读量:4205 次
发布时间:2019-05-26

本文共 2037 字,大约阅读时间需要 6 分钟。

 

match_results:

#include 
 template < typename BidirectionalIterator, typename Allocator = allocator
>> class match_results;

The class template match_results holds a collection of character sequences that represent the result of a regular expression match. Several specializations for common character sequence types are provided:

typedef match_results
cmatch;typedef match_results
wcmatch;typedef match_results
smatch;typedef match_results
wsmatch;
字匹配的类型
wssub_match csub_matchwcsub_matchssub_match
Member type Definition
sub_match<BidirectionalIterator> value_type
const value_type& const_reference
const_reference reference
(implementation-defined) const_iterator
const_iterator iterator
typename iterator_traits<BidirectionalIterator>::difference_type difference_type
typename allocator_traits<Allocator>::size_type size_type
Allocator allocator_type
typename iterator_traits<BidirectionalIterator>::value_type char_type
std::basic_string<char_type> string_type

create a match
assign values to a match
returns the allocator for this object
swaps the matched sub-expressions with another match_results
如果匹配成功,返回 1 + 匹配的子表达式个数
最多可存储子匹配的个数
返回true 当有至少一个子匹配时,否则返回false
the length of a particular sub-expression
the distance between the start of the target sequence and a given sub-expression
the sequence of characters for a given sub-expression
returns a reference to the for a specific sub-expression
the characters from the start of the original sequence to the beginning of the match
the characters from the end of the match to the end of the original sequence
an iterator that enumerates the sub-expressions in *this
an iterator that terminates the sub-expressions in *this

length(int sub=0) 指定子表达式的长度
position(int sub=0) 指定子表达式与被匹配串开头之间的字节数 
str(int sub=0) 指定子表达式匹配得到的字串的长度
[]返回子匹配
原始串的开头到第一个匹配点的字节数
匹配点的下一个位置到原始串结束的字节数

返回指向第一个子匹配(what[0])的迭代器

 

formats match results for output

 

转载地址:http://rfali.baihongyu.com/

你可能感兴趣的文章
【GoLang】Web工作方式
查看>>
Launch Sublime Text 3 from the command line
查看>>
【数据库之mysql】mysql的安装(一)
查看>>
【数据库之mysql】 mysql 入门教程(二)
查看>>
【HTML5/CSS/JS】A list of Font Awesome icons and their CSS content values(一)
查看>>
【HTML5/CSS/JS】<br>与<p>标签区别(二)
查看>>
【HTML5/CSS/JS】开发跨平台应用工具的选择(三)
查看>>
【心灵鸡汤】Give it five minutes不要让一个好主意随风而去
查看>>
【React Native】Invariant Violation: Application AwesomeProject has not been registered
查看>>
【ReactNative】真机上无法调试 could not connect to development server
查看>>
【XCode 4.6】常用快捷键 特别是格式化代码ctrl+i
查看>>
【iOS游戏开发】icon那点事 之 实际应用(二)
查看>>
【iOS游戏开发】icon那点事 之 图标设计(三)
查看>>
【IOS游戏开发】之测试发布(Distribution)
查看>>
【IOS游戏开发】之IPA破解原理
查看>>
【一天一道LeetCode】#45. Jump Game II
查看>>
【一天一道LeetCode】#46. Permutations
查看>>
【一天一道LeetCode】#47. Permutations II
查看>>
【一天一道LeetCode】#48. Rotate Image
查看>>
【一天一道LeetCode】#56. Merge Intervals
查看>>