tmp/tmpnybuvhjy/{from.md → to.md}
RENAMED
|
@@ -6,30 +6,29 @@ the regular expression library. This namespace provides three types,
|
|
| 6 |
several constants of these types.
|
| 7 |
|
| 8 |
### Bitmask type `syntax_option_type` <a id="re.synopt">[[re.synopt]]</a>
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
-
namespace std {
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
}
|
| 25 |
}
|
| 26 |
```
|
| 27 |
|
| 28 |
-
The type `syntax_option_type` is an implementation-defined bitmask
|
| 29 |
type ([[bitmask.types]]). Setting its elements has the effects listed
|
| 30 |
-
in
|
| 31 |
`syntax_option_type` shall have at most one of the grammar elements
|
| 32 |
`ECMAScript`, `basic`, `extended`, `awk`, `grep`, `egrep`, set. If no
|
| 33 |
grammar element is set, the default grammar is `ECMAScript`.
|
| 34 |
|
| 35 |
**Table: `syntax_option_type` effects** <a id="tab:re:syntaxoption">[tab:re:syntaxoption]</a>
|
|
@@ -44,38 +43,37 @@ grammar element is set, the default grammar is `ECMAScript`.
|
|
| 44 |
| % `basic` | Specifies that the grammar recognized by the regular expression engine shall be that used by basic regular expressions in POSIX, Base Definitions and Headers, Section 9, Regular Expressions. \indextext{POSIX!regular expressions}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{basic}}% |
|
| 45 |
| % `extended` | Specifies that the grammar recognized by the regular expression engine shall be that used by extended regular expressions in POSIX, Base Definitions and Headers, Section 9, Regular Expressions. \indextext{POSIX!extended regular expressions}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{extended}}% |
|
| 46 |
| % `awk` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility awk in POSIX. \indextext{\idxcode{awk}}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{awk}}% |
|
| 47 |
| % `grep` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility grep in POSIX. \indextext{\idxcode{grep}}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{grep}}% |
|
| 48 |
| % `egrep` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility grep when given the -E option in POSIX. \indextext{\idxcode{egrep}}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{egrep}}% |
|
|
|
|
| 49 |
|
| 50 |
|
| 51 |
-
### Bitmask type `
|
| 52 |
|
| 53 |
``` cpp
|
| 54 |
-
namespace std {
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
constexpr match_flag_type format_first_only = unspecified;
|
| 70 |
-
}
|
| 71 |
}
|
| 72 |
```
|
| 73 |
|
| 74 |
-
The type `
|
| 75 |
-
|
| 76 |
-
|
| 77 |
`match_default` and `format_default` constants are empty bitmasks.
|
| 78 |
Matching a regular expression against a sequence of characters
|
| 79 |
\[`first`, `last`) proceeds according to the rules of the grammar
|
| 80 |
specified for the regular expression object, modified according to the
|
| 81 |
effects listed in Table [[tab:re:matchflag]] for any bitmask elements
|
|
@@ -91,37 +89,35 @@ set.
|
|
| 91 |
| % \indexlibrary{\idxcode{match_not_bow}}% `match_not_bow` | The expression \verb|"b"| shall not match the sub-sequence {[}`first`, `first`{)}. |
|
| 92 |
| % \indexlibrary{\idxcode{match_not_eow}}% `match_not_eow` | The expression \verb|"b"| shall not match the sub-sequence {[}`last`, `last`{)}. |
|
| 93 |
| % \indexlibrary{\idxcode{match_any}}% `match_any` | If more than one match is possible then any match is an acceptable result. |
|
| 94 |
| % \indexlibrary{\idxcode{match_not_null}}% `match_not_null` | The expression shall not match an empty sequence. |
|
| 95 |
| % \indexlibrary{\idxcode{match_continuous}}% `match_continuous` | The expression shall only match a sub-sequence that begins at `first`. |
|
| 96 |
-
| % \indexlibrary{\idxcode{match_prev_avail}}% `match_prev_avail` | \verb!--first! is a valid iterator position. When this flag is set the flags match_not_bol and match_not_bow shall be ignored by the regular expression algorithms~
|
| 97 |
| % \indexlibrary{\idxcode{format_default}}% `format_default` | When a regular expression match is to be replaced by a new string, the new string shall be constructed using the rules used by the ECMAScript replace function in ECMA-262, part 15.5.4.11 String.prototype.replace. In addition, during search and replace operations all non-overlapping occurrences of the regular expression shall be located and replaced, and sections of the input that did not match the expression shall be copied unchanged to the output string. |
|
| 98 |
| % \indexlibrary{\idxcode{format_sed}}% `format_sed` | When a regular expression match is to be replaced by a new string, the new string shall be constructed using the rules used by the sed utility in POSIX. |
|
| 99 |
| % \indexlibrary{\idxcode{format_no_copy}}% `format_no_copy` | During a search and replace operation, sections of the character container sequence being searched that do not match the regular expression shall not be copied to the output string. |
|
| 100 |
| % \indexlibrary{\idxcode{format_first_only}}% `format_first_only` | When specified during a search and replace operation, only the first occurrence of the regular expression shall be replaced. |
|
| 101 |
|
| 102 |
|
| 103 |
### Implementation-defined `error_type` <a id="re.err">[[re.err]]</a>
|
| 104 |
|
| 105 |
``` cpp
|
| 106 |
-
namespace std {
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
constexpr error_type error_stack = unspecified;
|
| 122 |
-
}
|
| 123 |
}
|
| 124 |
```
|
| 125 |
|
| 126 |
The type `error_type` is an *implementation-defined* enumerated type (
|
| 127 |
[[enumerated.types]]). Values of type `error_type` represent the error
|
|
|
|
| 6 |
several constants of these types.
|
| 7 |
|
| 8 |
### Bitmask type `syntax_option_type` <a id="re.synopt">[[re.synopt]]</a>
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
+
namespace std::regex_constants {
|
| 12 |
+
using syntax_option_type = T1;
|
| 13 |
+
inline constexpr syntax_option_type icase = unspecified;
|
| 14 |
+
inline constexpr syntax_option_type nosubs = unspecified;
|
| 15 |
+
inline constexpr syntax_option_type optimize = unspecified;
|
| 16 |
+
inline constexpr syntax_option_type collate = unspecified;
|
| 17 |
+
inline constexpr syntax_option_type ECMAScript = unspecified;
|
| 18 |
+
inline constexpr syntax_option_type basic = unspecified;
|
| 19 |
+
inline constexpr syntax_option_type extended = unspecified;
|
| 20 |
+
inline constexpr syntax_option_type awk = unspecified;
|
| 21 |
+
inline constexpr syntax_option_type grep = unspecified;
|
| 22 |
+
inline constexpr syntax_option_type egrep = unspecified;
|
| 23 |
+
inline constexpr syntax_option_type multiline = unspecified;
|
|
|
|
| 24 |
}
|
| 25 |
```
|
| 26 |
|
| 27 |
+
The type `syntax_option_type` is an *implementation-defined* bitmask
|
| 28 |
type ([[bitmask.types]]). Setting its elements has the effects listed
|
| 29 |
+
in Table [[tab:re:syntaxoption]]. A valid value of type
|
| 30 |
`syntax_option_type` shall have at most one of the grammar elements
|
| 31 |
`ECMAScript`, `basic`, `extended`, `awk`, `grep`, `egrep`, set. If no
|
| 32 |
grammar element is set, the default grammar is `ECMAScript`.
|
| 33 |
|
| 34 |
**Table: `syntax_option_type` effects** <a id="tab:re:syntaxoption">[tab:re:syntaxoption]</a>
|
|
|
|
| 43 |
| % `basic` | Specifies that the grammar recognized by the regular expression engine shall be that used by basic regular expressions in POSIX, Base Definitions and Headers, Section 9, Regular Expressions. \indextext{POSIX!regular expressions}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{basic}}% |
|
| 44 |
| % `extended` | Specifies that the grammar recognized by the regular expression engine shall be that used by extended regular expressions in POSIX, Base Definitions and Headers, Section 9, Regular Expressions. \indextext{POSIX!extended regular expressions}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{extended}}% |
|
| 45 |
| % `awk` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility awk in POSIX. \indextext{\idxcode{awk}}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{awk}}% |
|
| 46 |
| % `grep` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility grep in POSIX. \indextext{\idxcode{grep}}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{grep}}% |
|
| 47 |
| % `egrep` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility grep when given the -E option in POSIX. \indextext{\idxcode{egrep}}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{egrep}}% |
|
| 48 |
+
| % `multiline` | Specifies that `\^` shall match the beginning of a line and `$` shall match the end of a line, if the `ECMAScript` engine is selected. \indextext{\idxcode{multiline}}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{multiline}}% |
|
| 49 |
|
| 50 |
|
| 51 |
+
### Bitmask type `match_flag_type` <a id="re.matchflag">[[re.matchflag]]</a>
|
| 52 |
|
| 53 |
``` cpp
|
| 54 |
+
namespace std::regex_constants {
|
| 55 |
+
using match_flag_type = T2;
|
| 56 |
+
inline constexpr match_flag_type match_default = {};
|
| 57 |
+
inline constexpr match_flag_type match_not_bol = unspecified;
|
| 58 |
+
inline constexpr match_flag_type match_not_eol = unspecified;
|
| 59 |
+
inline constexpr match_flag_type match_not_bow = unspecified;
|
| 60 |
+
inline constexpr match_flag_type match_not_eow = unspecified;
|
| 61 |
+
inline constexpr match_flag_type match_any = unspecified;
|
| 62 |
+
inline constexpr match_flag_type match_not_null = unspecified;
|
| 63 |
+
inline constexpr match_flag_type match_continuous = unspecified;
|
| 64 |
+
inline constexpr match_flag_type match_prev_avail = unspecified;
|
| 65 |
+
inline constexpr match_flag_type format_default = {};
|
| 66 |
+
inline constexpr match_flag_type format_sed = unspecified;
|
| 67 |
+
inline constexpr match_flag_type format_no_copy = unspecified;
|
| 68 |
+
inline constexpr match_flag_type format_first_only = unspecified;
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
```
|
| 71 |
|
| 72 |
+
The type `match_flag_type` is an *implementation-defined* bitmask type (
|
| 73 |
+
[[bitmask.types]]). The constants of that type, except for
|
| 74 |
+
`match_default` and `format_default`, are bitmask elements. The
|
| 75 |
`match_default` and `format_default` constants are empty bitmasks.
|
| 76 |
Matching a regular expression against a sequence of characters
|
| 77 |
\[`first`, `last`) proceeds according to the rules of the grammar
|
| 78 |
specified for the regular expression object, modified according to the
|
| 79 |
effects listed in Table [[tab:re:matchflag]] for any bitmask elements
|
|
|
|
| 89 |
| % \indexlibrary{\idxcode{match_not_bow}}% `match_not_bow` | The expression \verb|"b"| shall not match the sub-sequence {[}`first`, `first`{)}. |
|
| 90 |
| % \indexlibrary{\idxcode{match_not_eow}}% `match_not_eow` | The expression \verb|"b"| shall not match the sub-sequence {[}`last`, `last`{)}. |
|
| 91 |
| % \indexlibrary{\idxcode{match_any}}% `match_any` | If more than one match is possible then any match is an acceptable result. |
|
| 92 |
| % \indexlibrary{\idxcode{match_not_null}}% `match_not_null` | The expression shall not match an empty sequence. |
|
| 93 |
| % \indexlibrary{\idxcode{match_continuous}}% `match_continuous` | The expression shall only match a sub-sequence that begins at `first`. |
|
| 94 |
+
| % \indexlibrary{\idxcode{match_prev_avail}}% `match_prev_avail` | \verb!--first! is a valid iterator position. When this flag is set the flags `match_not_bol` and `match_not_bow` shall be ignored by the regular expression algorithms~([[re.alg]]) and iterators~([[re.iter]]). |
|
| 95 |
| % \indexlibrary{\idxcode{format_default}}% `format_default` | When a regular expression match is to be replaced by a new string, the new string shall be constructed using the rules used by the ECMAScript replace function in ECMA-262, part 15.5.4.11 String.prototype.replace. In addition, during search and replace operations all non-overlapping occurrences of the regular expression shall be located and replaced, and sections of the input that did not match the expression shall be copied unchanged to the output string. |
|
| 96 |
| % \indexlibrary{\idxcode{format_sed}}% `format_sed` | When a regular expression match is to be replaced by a new string, the new string shall be constructed using the rules used by the sed utility in POSIX. |
|
| 97 |
| % \indexlibrary{\idxcode{format_no_copy}}% `format_no_copy` | During a search and replace operation, sections of the character container sequence being searched that do not match the regular expression shall not be copied to the output string. |
|
| 98 |
| % \indexlibrary{\idxcode{format_first_only}}% `format_first_only` | When specified during a search and replace operation, only the first occurrence of the regular expression shall be replaced. |
|
| 99 |
|
| 100 |
|
| 101 |
### Implementation-defined `error_type` <a id="re.err">[[re.err]]</a>
|
| 102 |
|
| 103 |
``` cpp
|
| 104 |
+
namespace std::regex_constants {
|
| 105 |
+
using error_type = T3;
|
| 106 |
+
inline constexpr error_type error_collate = unspecified;
|
| 107 |
+
inline constexpr error_type error_ctype = unspecified;
|
| 108 |
+
inline constexpr error_type error_escape = unspecified;
|
| 109 |
+
inline constexpr error_type error_backref = unspecified;
|
| 110 |
+
inline constexpr error_type error_brack = unspecified;
|
| 111 |
+
inline constexpr error_type error_paren = unspecified;
|
| 112 |
+
inline constexpr error_type error_brace = unspecified;
|
| 113 |
+
inline constexpr error_type error_badbrace = unspecified;
|
| 114 |
+
inline constexpr error_type error_range = unspecified;
|
| 115 |
+
inline constexpr error_type error_space = unspecified;
|
| 116 |
+
inline constexpr error_type error_badrepeat = unspecified;
|
| 117 |
+
inline constexpr error_type error_complexity = unspecified;
|
| 118 |
+
inline constexpr error_type error_stack = unspecified;
|
|
|
|
|
|
|
| 119 |
}
|
| 120 |
```
|
| 121 |
|
| 122 |
The type `error_type` is an *implementation-defined* enumerated type (
|
| 123 |
[[enumerated.types]]). Values of type `error_type` represent the error
|