C ++库 - <regex>

简介

这是一种表达与字符序列匹配的模式的标准化方法.一些典型的正则表达式参数如下所示 :

  • 目标序列(主题)号;它用于搜索序列模式.

  • 正则表达式(模式) : 它用于在目标序列中搜索.

  • 匹配数组 : 匹配信息存储在一个特殊的match_results数组类型中(例如cmatch或smatch).

  • 替换strin : 此操作将替换匹配.

正则表达式操作

Sr.No.正则表达式操作和放大器; description
1regex_match

这是一个匹配序列.

2regex_search

这是一个搜索序列.

3regex_replace

这是替换匹配序列.

迭代器类型

Sr.No.Iterator type& description
1regex_iterator

这是一个正则表达式迭代器.

2regex_token_iterator

它是一个正则表达式令牌迭代器.

basic_regex instantiations

Sr.No.实例化& description
1regex

这是一个正则表达式类.

2wregex

这是一个wregex类.

match_results instantiations

Sr.No.match_results instantiation& description
1cmatch

这些是字符串文字的match_results.

2wcmatch

这些是宽字符串文字的match_results.

3smatch

这些是字符串对象的match_results.

4wsmatch

这些是宽字符串对象的match_results.

sub_match instantiations

Sr.No.sub_match instantiation& description
1csub_match

这是字符串文字的sub_match.

2wcsub_match

这是宽字符串文字的sub_match.

3ssub_match

这是一个sub_match字符串.

4wssub_match

这是宽字符串的sub_match.

命名空间

Sr.No.命名空间&安培; description
1regex_constants

这是一个正则表达式常量.