From Jason Turner

[re.const]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp2ek8sg6o/{from.md → to.md} +10 -11
tmp/tmp2ek8sg6o/{from.md → to.md} RENAMED
@@ -1,15 +1,15 @@
1
- ## Namespace `std::regex_constants` <a id="re.const">[[re.const]]</a>
2
 
3
- ### General <a id="re.const.general">[[re.const.general]]</a>
4
 
5
  The namespace `std::regex_constants` holds symbolic constants used by
6
  the regular expression library. This namespace provides three types,
7
  `syntax_option_type`, `match_flag_type`, and `error_type`, along with
8
  several constants of these types.
9
 
10
- ### Bitmask type `syntax_option_type` <a id="re.synopt">[[re.synopt]]</a>
11
 
12
  ``` cpp
13
  namespace std::regex_constants {
14
  using syntax_option_type = T1;
15
  inline constexpr syntax_option_type icase = unspecified;
@@ -39,20 +39,20 @@ grammar is `ECMAScript`.
39
  | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
  | % `icase` | Specifies that matching of regular expressions against a character container sequence shall be performed without regard to case. \indexlibrarymember{syntax_option_type}{icase}% |
41
  | % `nosubs` | Specifies that no sub-expressions shall be considered to be marked, so that when a regular expression is matched against a character container sequence, no sub-expression matches shall be stored in the supplied `match_results` object. \indexlibrarymember{syntax_option_type}{nosubs}% |
42
  | % `optimize` | Specifies that the regular expression engine should pay more attention to the speed with which regular expressions are matched, and less to the speed with which regular expression objects are constructed. Otherwise it has no detectable effect on the program output. \indexlibrarymember{syntax_option_type}{optimize}% |
43
  | % `collate` | Specifies that character ranges of the form `"[a-b]"` shall be locale sensitive.% \indexlibrarymember{syntax_option_type}{collate}% \indextext{locale}% |
44
- | % `ECMAScript` | Specifies that the grammar recognized by the regular expression engine shall be that used by ECMAScript in ECMA-262, as modified in~ [[re.grammar]]. \xref ECMA-262 15.10 \indextext{ECMAScript}% \indexlibrarymember{syntax_option_type}{ECMAScript}% |
45
- | % `basic` | Specifies that the grammar recognized by the regular expression engine shall be that used by basic regular expressions in POSIX. \xref POSIX, Base Definitions and Headers, Section 9.3 \indextext{POSIX!regular expressions}% \indexlibrarymember{syntax_option_type}{basic}% |
46
- | % `extended` | Specifies that the grammar recognized by the regular expression engine shall be that used by extended regular expressions in POSIX. \xref POSIX, Base Definitions and Headers, Section 9.4 \indextext{POSIX!extended regular expressions}% \indexlibrarymember{syntax_option_type}{extended}% |
47
  | % `awk` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility awk in POSIX. \indexlibrarymember{syntax_option_type}{awk}% |
48
  | % `grep` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility grep in POSIX. \indexlibrarymember{syntax_option_type}{grep}% |
49
  | % `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. \indexlibrarymember{syntax_option_type}{egrep}% |
50
  | % `multiline` | Specifies that `^` shall match the beginning of a line and `$` shall match the end of a line, if the `ECMAScript` engine is selected. \indexlibrarymember{syntax_option_type}{multiline}% |
51
 
52
 
53
- ### Bitmask type `match_flag_type` <a id="re.matchflag">[[re.matchflag]]</a>
54
 
55
  ``` cpp
56
  namespace std::regex_constants {
57
  using match_flag_type = T2;
58
  inline constexpr match_flag_type match_default = {};
@@ -78,12 +78,11 @@ The type `match_flag_type` is an *implementation-defined* bitmask type
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 [[re.matchflag]] for any bitmask elements set.
82
 
83
- **Table: `regex_constants::match_flag_type` effects when obtaining a match against a
84
- character container sequence {[}`first`, `last`{)}.** <a id="re.matchflag">[re.matchflag]</a>
85
 
86
  | Element | Effect(s) if set |
87
  | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
88
  | % \indexlibraryglobal{match_not_bol}% `match_not_bol` | The first character in the sequence {[}`first`, `last`{)} shall be treated as though it is not at the beginning of a line, so the character \verb|^| in the regular expression shall not match {[}`first`, `first`{)}. |
89
  | % \indexlibraryglobal{match_not_eol}% `match_not_eol` | The last character in the sequence {[}`first`, `last`{)} shall be treated as though it is not at the end of a line, so the character \verb|"$"| in the regular expression shall not match {[}`last`, `last`{)}. |
@@ -97,11 +96,11 @@ effects listed in [[re.matchflag]] for any bitmask elements set.
97
  | % \indexlibraryglobal{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. |
98
  | % \indexlibraryglobal{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. |
99
  | % \indexlibraryglobal{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. |
100
 
101
 
102
- ### Implementation-defined `error_type` <a id="re.err">[[re.err]]</a>
103
 
104
  ``` cpp
105
  namespace std::regex_constants {
106
  using error_type = T3;
107
  inline constexpr error_type error_collate = unspecified;
@@ -132,11 +131,11 @@ conditions described in [[re.err]]:
132
  | % `error_ctype` | The expression contains an invalid character class name. |
133
  | % `error_escape` | The expression contains an invalid escaped character, or a trailing escape. |
134
  | % `error_backref` | The expression contains an invalid back reference. |
135
  | % `error_brack` | The expression contains mismatched \verb|[| and \verb|]|. |
136
  | % `error_paren` | The expression contains mismatched \verb|(| and \verb|)|. |
137
- | % `error_brace` | The expression contains mismatched \verb|{| and \verb|}| |
138
  | % `error_badbrace` | The expression contains an invalid range in a \verb|{}| expression. |
139
  | % `error_range` | The expression contains an invalid character range, such as \verb|[b-a]| in most encodings. |
140
  | % `error_space` | There is insufficient memory to convert the expression into a finite state machine. |
141
  | % `error_badrepeat` | One of \verb|*?+{| is not preceded by a valid regular expression. |
142
  | % `error_complexity` | The complexity of an attempted match against a regular expression exceeds a pre-set level. |
 
1
+ ### Namespace `std::regex_constants` <a id="re.const">[[re.const]]</a>
2
 
3
+ #### General <a id="re.const.general">[[re.const.general]]</a>
4
 
5
  The namespace `std::regex_constants` holds symbolic constants used by
6
  the regular expression library. This namespace provides three types,
7
  `syntax_option_type`, `match_flag_type`, and `error_type`, along with
8
  several constants of these types.
9
 
10
+ #### Bitmask type `syntax_option_type` <a id="re.synopt">[[re.synopt]]</a>
11
 
12
  ``` cpp
13
  namespace std::regex_constants {
14
  using syntax_option_type = T1;
15
  inline constexpr syntax_option_type icase = unspecified;
 
39
  | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
  | % `icase` | Specifies that matching of regular expressions against a character container sequence shall be performed without regard to case. \indexlibrarymember{syntax_option_type}{icase}% |
41
  | % `nosubs` | Specifies that no sub-expressions shall be considered to be marked, so that when a regular expression is matched against a character container sequence, no sub-expression matches shall be stored in the supplied `match_results` object. \indexlibrarymember{syntax_option_type}{nosubs}% |
42
  | % `optimize` | Specifies that the regular expression engine should pay more attention to the speed with which regular expressions are matched, and less to the speed with which regular expression objects are constructed. Otherwise it has no detectable effect on the program output. \indexlibrarymember{syntax_option_type}{optimize}% |
43
  | % `collate` | Specifies that character ranges of the form `"[a-b]"` shall be locale sensitive.% \indexlibrarymember{syntax_option_type}{collate}% \indextext{locale}% |
44
+ | % `ECMAScript` | Specifies that the grammar recognized by the regular expression engine shall be that used by ECMAScript in ECMA-262, as modified in~ [[re.grammar]]. \xref{ECMA-262 15.10} \indextext{ECMAScript}% \indexlibrarymember{syntax_option_type}{ECMAScript}% |
45
+ | % `basic` | Specifies that the grammar recognized by the regular expression engine shall be that used by basic regular expressions in POSIX. \xref{POSIX, Base Definitions and Headers, Section 9.3} \indextext{POSIX!regular expressions}% \indexlibrarymember{syntax_option_type}{basic}% |
46
+ | % `extended` | Specifies that the grammar recognized by the regular expression engine shall be that used by extended regular expressions in POSIX. \xref{POSIX, Base Definitions and Headers, Section 9.4} \indextext{POSIX!extended regular expressions}% \indexlibrarymember{syntax_option_type}{extended}% |
47
  | % `awk` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility awk in POSIX. \indexlibrarymember{syntax_option_type}{awk}% |
48
  | % `grep` | Specifies that the grammar recognized by the regular expression engine shall be that used by the utility grep in POSIX. \indexlibrarymember{syntax_option_type}{grep}% |
49
  | % `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. \indexlibrarymember{syntax_option_type}{egrep}% |
50
  | % `multiline` | Specifies that `^` shall match the beginning of a line and `$` shall match the end of a line, if the `ECMAScript` engine is selected. \indexlibrarymember{syntax_option_type}{multiline}% |
51
 
52
 
53
+ #### Bitmask type `match_flag_type` <a id="re.matchflag">[[re.matchflag]]</a>
54
 
55
  ``` cpp
56
  namespace std::regex_constants {
57
  using match_flag_type = T2;
58
  inline constexpr match_flag_type match_default = {};
 
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 [[re.matchflag]] for any bitmask elements set.
82
 
83
+ **Table: `regex_constants::match_flag_type` effects** <a id="re.matchflag">[re.matchflag]</a>
 
84
 
85
  | Element | Effect(s) if set |
86
  | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
87
  | % \indexlibraryglobal{match_not_bol}% `match_not_bol` | The first character in the sequence {[}`first`, `last`{)} shall be treated as though it is not at the beginning of a line, so the character \verb|^| in the regular expression shall not match {[}`first`, `first`{)}. |
88
  | % \indexlibraryglobal{match_not_eol}% `match_not_eol` | The last character in the sequence {[}`first`, `last`{)} shall be treated as though it is not at the end of a line, so the character \verb|"$"| in the regular expression shall not match {[}`last`, `last`{)}. |
 
96
  | % \indexlibraryglobal{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
  | % \indexlibraryglobal{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
  | % \indexlibraryglobal{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;
 
131
  | % `error_ctype` | The expression contains an invalid character class name. |
132
  | % `error_escape` | The expression contains an invalid escaped character, or a trailing escape. |
133
  | % `error_backref` | The expression contains an invalid back reference. |
134
  | % `error_brack` | The expression contains mismatched \verb|[| and \verb|]|. |
135
  | % `error_paren` | The expression contains mismatched \verb|(| and \verb|)|. |
136
+ | % `error_brace` | The expression contains mismatched \verb|{| and \verb|}|. |
137
  | % `error_badbrace` | The expression contains an invalid range in a \verb|{}| expression. |
138
  | % `error_range` | The expression contains an invalid character range, such as \verb|[b-a]| in most encodings. |
139
  | % `error_space` | There is insufficient memory to convert the expression into a finite state machine. |
140
  | % `error_badrepeat` | One of \verb|*?+{| is not preceded by a valid regular expression. |
141
  | % `error_complexity` | The complexity of an attempted match against a regular expression exceeds a pre-set level. |