| Localization library | |||||||||||||||||||||||||
| Regular expressions library(C++11) | |||||||||||||||||||||||||
| Formatting library(C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
| Classes | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
| Algorithms | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
| Iterators | ||||
(C++11) | ||||
(C++11) | ||||
| Exceptions | ||||
(C++11) | ||||
| Traits | ||||
(C++11) | ||||
| Constants | ||||
(C++11) | ||||
match_flag_type (C++11) | ||||
(C++11) | ||||
| Regex Grammar | ||||
(C++11) |
Defined in header <regex> | ||
using match_flag_type=/* implementation-defined */; | (1) | (since C++11) |
constexpr match_flag_type match_default= {}; constexpr match_flag_type match_not_bol= /* unspecified */; | (2) | (since C++11) (inline since C++17) |
Note:[first, last) refers to the character sequence being matched.
| Name | Explanation |
match_not_bol | The first character in[first, last) will be treated as if it isnot at the beginning of a line(i.e. ^ will not match[first, first)). |
match_not_eol | The last character in[first, last) will be treated as if it isnot at the end of a line(i.e. $ will not match[last, last)). |
match_not_bow | \b will not match[first, first). |
match_not_eow | \b will not match[last, last). |
match_any | If more than one match is possible, then any match is an acceptable result. |
match_not_null | Do not match empty sequences. |
match_continuous | Only match a sub-sequence that begins atfirst. |
match_prev_avail | --first is a valid iterator position. When set, causes match_not_bol andmatch_not_bow to be ignored. |
format_default | Use ECMAScript rules to construct strings instd::regex_replace (syntax documentation). |
format_sed | Use POSIXsed utility rules instd::regex_replace (syntax documentation). |
format_no_copy | Do not copy un-matched strings to the output instd::regex_replace. |
format_first_only | Only replace the first match instd::regex_replace. |
All constants, except formatch_default andformat_default, are bitmask elements. Thematch_default andformat_default constants are empty bitmasks.
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 2053 | C++11 | 1. the constants were declaredstatic 2. match_default andformat_default were initialized from0 | 1. removed thestatic specifier 2. initialized from{} |
(C++11) | attempts to match a regular expression to an entire character sequence (function template)[edit] |
(C++11) | general options controlling regex behavior (typedef)[edit] |
(C++11) | describes different types of matching errors (typedef)[edit] |