Regular expressions library
来自cppreference.com
< cpp
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
正则表达式库提供了一个类,它代表正则表达式,这是一种迷你语言用来执行模式匹配字符串中的.
Original:
The regular expressions library provides a class that represents 正则表达式, which are a kind of mini-language used to perform pattern matching within strings.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
还提供了在正则表达式库提供支持的各种算法,迭代器,例外,和类型特征的实用工具类.
Original:
Also provided in the regular expressions library are utility classes that provide support for various algorithms, iterators, exceptions, and type traits.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目录 |
[编辑] 主类
这些类封装了一个正则表达式和目标内的字符序列匹配正则表达式的结果.
Original:
These classes encapsulate a regular expression and the results of matching a regular expression within a target sequence of characters.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
(C++11) |
正则表达式对象 Original: regular expression object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类模板) |
(C++11) |
标识由一个子表达式匹配的字符序列 Original: identifies the sequence of characters matched by a sub-expression The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类模板) |
(C++11) |
确定一个正则表达式匹配,包括所有的子表达式匹配 Original: identifies one regular expression match, including all sub-expression matches The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类模板) |
[编辑] 算法
使用这些功能应用正则表达式封装在一个正则表达式的字符序列目标..
Original:
These functions are used to apply the regular expression encapsulated in a regex to a target sequence of characters..
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
(C++11) |
尝试匹配正则表达式的整个字符序列 Original: attempts to match a regular expression to the entire character sequence The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) |
(C++11) |
尝试匹配正则表达式的字符序列的任何部分 Original: attempts to match a regular expression to any part of the character sequence The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) |
(C++11) |
以格式化的替换文本来替换正则表达式匹配的地方 (函数模板) |
[编辑] 迭代器
正则表达式使用迭代器遍历整个正则表达式匹配的组序列中找到.
Original:
The regex iterators are used to traverse the entire set of regular expression matches found within a sequence.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
(C++11) |
遍历所有正则表达式匹配的字符序列内 Original: iterates through all regex matches within a character sequence The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类模板) |
(C++11) |
遍历指定的子表达式内的所有正则表达式匹配一个给定的字符串或通过无与伦比的子串 Original: iterates through the specified sub-expressions within all regex matches in a given string or through unmatched substrings The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类模板) |
[编辑] 例外
这个类定义类型的对象抛出异常来报告错误的正则表达式库.
Original:
This class defines the type of objects thrown as exceptions to report errors from the regular expressions library.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
(C++11) |
报告错误所产生的正则表达式库 Original: reports errors generated by the regular expressions library The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类) |
[编辑] 性状
正则表达式traits类用于封装一个正则表达式的本地化方面的.
Original:
The regex traits class is used to encapsulate the localizable aspects of a regex.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
(C++11) |
字符类型,所要求的正则表达式库,提供元信息 Original: provides metainformation about a character type, required by the regex library The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类模板) |
[编辑] 常量
Defined in namespace
std::regex_constants | |
(C++11) |
常规选项控制正则表达式的行为 Original: general options controlling regex behavior The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (的typedef) |
(C++11) |
特定匹配的选项 Original: options specific to matching The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (的typedef) |
(C++11) |
描述了不同类型的匹配误差 Original: describes different types of matching errors The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (的typedef) |