定义模板类分析TR1 Regular Expressions,和多个模板类和函数,可在搜索文本的正则表达式对象的匹配项。
#include <regex>
备注
若要创建一个正则表达式对象,使用模板类basic_regex Class或其专用化, regex Typedef和wregex Typedef语法标记类型的同时, regex_constants::syntax_option_type。
要搜索文本匹配正则表达式对象,请使用的模板函数regex_match Function和regex_search Function匹配标记类型的同时, regex_constants::match_flag_type。这些函数返回的结果使用的模板类match_results Class和其专用化, cmatch Typedef, wcmatch Typedef, smatch Typedef,和wsmatch Typedef模板类同时, sub_match Class和其专用化, csub_match Typedef, wcsub_match Typedef, ssub_match Typedef,和wssub_match Typedef。
要替换的文本相匹配的正则表达式对象,请使用模板函数regex_replace Function匹配标记类型的同时, regex_constants::match_flag_type。
若要循环访问多个匹配的正则表达式对象,使用的模板类regex_iterator Class和regex_token_iterator Class或其专用化, cregex_iterator Typedef, sregex_iterator Typedef, wcregex_iterator Typedef, wsregex_iterator Typedef, cregex_token_iterator Typedef, sregex_token_iterator Typedef, wcregex_token_iterator Typedef,或wsregex_token_iterator Typedef匹配标记类型的同时, regex_constants::match_flag_type。
要修改的正则表达式语法的详细信息,请编写实现正则表达式具有相同特性的类。
类
换行的正则表达式。 |
|
包含一个子匹配项的序列。 |
|
包含各种类型的常量。 |
|
报告错误的正则表达式。 |
|
循环访问匹配结果。 |
|
描述用于匹配的元素的特征。 |
|
描述特征的char进行匹配。 |
|
描述特征的wchar_t进行匹配。 |
|
循环访问子匹配项。 |
|
描述子匹配项。 |
类型定义
键入用于定义charmatch_results。 |
|
键入用于定义charregex_iterator。 |
|
键入用于定义charregex_token_iterator。 |
|
键入用于定义charsub_match。 |
|
键入用于定义charbasic_regex。 |
|
键入用于定义stringmatch_results。 |
|
键入用于定义stringregex_iterator。 |
|
键入用于定义stringregex_token_iterator。 |
|
键入用于定义stringsub_match。 |
|
键入用于定义wchar_tmatch_results。 |
|
键入用于定义wchar_tregex_iterator。 |
|
键入用于定义wchar_tregex_token_iterator。 |
|
键入用于定义wchar_tsub_match。 |
|
键入用于定义wchar_tbasic_regex。 |
|
键入用于定义wstringmatch_results。 |
|
键入用于定义wstringregex_iterator。 |
|
键入用于定义wstringregex_token_iterator。 |
|
键入用于定义wstringsub_match。 |
函数
与完全匹配的正则表达式。 |
|
替换匹配正则表达式。 |
|
正则表达式匹配搜索。 |
|
Swaps basic_regex or match_results objects. |
运算符
相等的各种对象进行比较。 |
|
各种对象不等于比较。 |
|
比较各种不同的对象内。 |
|
各种对象小于或等于比较。 |
|
大于的各种对象进行比较。 |
|
各种对象大于或等于比较。 |
|
插入sub_match在流中。 |