From Jason Turner

[re.const]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp30w_ttjx/{from.md → to.md} +71 -67
tmp/tmp30w_ttjx/{from.md → to.md} RENAMED
@@ -9,114 +9,118 @@ several constants of these types.
9
 
10
  ``` cpp
11
  namespace std {
12
  namespace regex_constants {
13
  typedef T1 syntax_option_type;
14
- static constexpr syntax_option_type icase = unspecified;
15
- static constexpr syntax_option_type nosubs = unspecified;
16
- static constexpr syntax_option_type optimize = unspecified;
17
- static constexpr syntax_option_type collate = unspecified;
18
- static constexpr syntax_option_type ECMAScript = unspecified;
19
- static constexpr syntax_option_type basic = unspecified;
20
- static constexpr syntax_option_type extended = unspecified;
21
- static constexpr syntax_option_type awk = unspecified;
22
- static constexpr syntax_option_type grep = unspecified;
23
- static constexpr syntax_option_type egrep = unspecified;
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 table  [[tab:re:syntaxoption]]. A valid value of type
31
- `syntax_option_type` shall have exactly one of the elements
32
- `ECMAScript`, `basic`, `extended`, `awk`, `grep`, `egrep`, set.
 
33
 
34
  **Table: `syntax_option_type` effects** <a id="tab:re:syntaxoption">[tab:re:syntaxoption]</a>
35
 
36
  | Element | Effect(s) if set |
37
- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
38
- | % icase | Specifies that matching of regular expressions against a character container sequence shall be performed without regard to case. \indexlibrary{\idxcode{syntax_option_type}!\idxcode{icase}}% |
39
- | % nosubs | Specifies that when a regular expression is matched against a character container sequence, no sub-expression matches shall be stored in the supplied match_results structure. \indexlibrary{\idxcode{syntax_option_type}!\idxcode{nosubs}}% |
40
- | % 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. \indexlibrary{\idxcode{syntax_option_type}!\idxcode{optimize}}% |
41
- | % collate | Specifies that character ranges of the form `"[a-b]"` shall be locale sensitive. \indexlibrary{\idxcode{syntax_option_type}!\idxcode{collate}}% \indextext{locale}% |
42
- | % 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]]. \indextext{ECMAScript}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{ECMAScript}}% |
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
 
49
 
50
  ### Bitmask type `regex_constants::match_flag_type` <a id="re.matchflag">[[re.matchflag]]</a>
51
 
52
  ``` cpp
53
  namespace std {
54
  namespace regex_constants{
55
  typedef T2 match_flag_type;
56
- static constexpr match_flag_type match_default = 0
57
- static constexpr match_flag_type match_not_bol = unspecified;
58
- static constexpr match_flag_type match_not_eol = unspecified;
59
- static constexpr match_flag_type match_not_bow = unspecified;
60
- static constexpr match_flag_type match_not_eow = unspecified;
61
- static constexpr match_flag_type match_any = unspecified;
62
- static constexpr match_flag_type match_not_null = unspecified;
63
- static constexpr match_flag_type match_continuous = unspecified;
64
- static constexpr match_flag_type match_prev_avail = unspecified;
65
- static constexpr match_flag_type format_default = 0;
66
- static constexpr match_flag_type format_sed = unspecified;
67
- static constexpr match_flag_type format_no_copy = unspecified;
68
- static constexpr match_flag_type format_first_only = unspecified;
69
  }
70
  }
71
  ```
72
 
73
  The type `regex_constants::match_flag_type` is an implementation-defined
74
- bitmask type ([[bitmask.types]]). Matching a regular expression against
75
- a sequence of characters \[`first`, `last`) proceeds according to the
76
- rules of the grammar specified for the regular expression object,
77
- modified according to the effects listed in Table  [[tab:re:matchflag]]
78
- for any bitmask elements set.
 
 
 
79
 
80
  **Table: `regex_constants::match_flag_type` effects when obtaining a match against a
81
  character container sequence {[}`first`, `last`{)}.** <a id="tab:re:matchflag">[tab:re:matchflag]</a>
82
 
83
  | Element | Effect(s) if set |
84
- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
85
- | % \indexlibrary{\idxcode{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`{)}. |
86
- | % \indexlibrary{\idxcode{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`{)}. |
87
- | % \indexlibrary{\idxcode{match_not_bow}}% match_not_bow | The expression \verb|"\b"| shall not match the sub-sequence {[}`first`, `first`{)}. |
88
- | % \indexlibrary{\idxcode{match_not_eow}}% match_not_eow | The expression \verb|"\b"| shall not match the sub-sequence {[}`last`, `last`{)}. |
89
- | % \indexlibrary{\idxcode{match_any}}% match_any | If more than one match is possible then any match is an acceptable result. |
90
- | % \indexlibrary{\idxcode{match_not_null}}% match_not_null | The expression shall not match an empty sequence. |
91
- | % \indexlibrary{\idxcode{match_continuous}}% match_continuous | The expression shall only match a sub-sequence that begins at `first`. |
92
- | % \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]]. |
93
- | % \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. |
94
- | % \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. |
95
- | % \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. |
96
- | % \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. |
97
 
98
 
99
  ### Implementation-defined `error_type` <a id="re.err">[[re.err]]</a>
100
 
101
  ``` cpp
102
  namespace std {
103
  namespace regex_constants {
104
  typedef T3 error_type;
105
- static constexpr error_type error_collate = unspecified;
106
- static constexpr error_type error_ctype = unspecified;
107
- static constexpr error_type error_escape = unspecified;
108
- static constexpr error_type error_backref = unspecified;
109
- static constexpr error_type error_brack = unspecified;
110
- static constexpr error_type error_paren = unspecified;
111
- static constexpr error_type error_brace = unspecified;
112
- static constexpr error_type error_badbrace = unspecified;
113
- static constexpr error_type error_range = unspecified;
114
- static constexpr error_type error_space = unspecified;
115
- static constexpr error_type error_badrepeat = unspecified;
116
- static constexpr error_type error_complexity = unspecified;
117
- static constexpr error_type error_stack = unspecified;
118
  }
119
  }
120
  ```
121
 
122
  The type `error_type` is an *implementation-defined* enumerated type (
 
9
 
10
  ``` cpp
11
  namespace std {
12
  namespace regex_constants {
13
  typedef T1 syntax_option_type;
14
+ constexpr syntax_option_type icase = unspecified;
15
+ constexpr syntax_option_type nosubs = unspecified;
16
+ constexpr syntax_option_type optimize = unspecified;
17
+ constexpr syntax_option_type collate = unspecified;
18
+ constexpr syntax_option_type ECMAScript = unspecified;
19
+ constexpr syntax_option_type basic = unspecified;
20
+ constexpr syntax_option_type extended = unspecified;
21
+ constexpr syntax_option_type awk = unspecified;
22
+ constexpr syntax_option_type grep = unspecified;
23
+ constexpr syntax_option_type egrep = unspecified;
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 table  [[tab:re:syntaxoption]]. A valid value of type
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>
36
 
37
  | Element | Effect(s) if set |
38
+ | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39
+ | % `icase` | Specifies that matching of regular expressions against a character container sequence shall be performed without regard to case. \indexlibrary{\idxcode{syntax_option_type}!\idxcode{icase}}% |
40
+ | % `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` structure. \indexlibrary{\idxcode{syntax_option_type}!\idxcode{nosubs}}% |
41
+ | % `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. \indexlibrary{\idxcode{syntax_option_type}!\idxcode{optimize}}% |
42
+ | % `collate` | Specifies that character ranges of the form `"[a-b]"` shall be locale sensitive. \indexlibrary{\idxcode{syntax_option_type}!\idxcode{collate}}% \indextext{locale}% |
43
+ | % `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]]. \indextext{ECMAScript}% \indexlibrary{\idxcode{syntax_option_type}!\idxcode{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 `regex_constants::match_flag_type` <a id="re.matchflag">[[re.matchflag]]</a>
52
 
53
  ``` cpp
54
  namespace std {
55
  namespace regex_constants{
56
  typedef T2 match_flag_type;
57
+ constexpr match_flag_type match_default = {};
58
+ constexpr match_flag_type match_not_bol = unspecified;
59
+ constexpr match_flag_type match_not_eol = unspecified;
60
+ constexpr match_flag_type match_not_bow = unspecified;
61
+ constexpr match_flag_type match_not_eow = unspecified;
62
+ constexpr match_flag_type match_any = unspecified;
63
+ constexpr match_flag_type match_not_null = unspecified;
64
+ constexpr match_flag_type match_continuous = unspecified;
65
+ constexpr match_flag_type match_prev_avail = unspecified;
66
+ constexpr match_flag_type format_default = {};
67
+ constexpr match_flag_type format_sed = unspecified;
68
+ constexpr match_flag_type format_no_copy = unspecified;
69
+ constexpr match_flag_type format_first_only = unspecified;
70
  }
71
  }
72
  ```
73
 
74
  The type `regex_constants::match_flag_type` is an implementation-defined
75
+ bitmask type ([[bitmask.types]]). The constants of that type, except
76
+ for `match_default` and `format_default`, are bitmask elements. The
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
82
+ set.
83
 
84
  **Table: `regex_constants::match_flag_type` effects when obtaining a match against a
85
  character container sequence {[}`first`, `last`{)}.** <a id="tab:re:matchflag">[tab:re:matchflag]</a>
86
 
87
  | Element | Effect(s) if set |
88
+ | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
89
+ | % \indexlibrary{\idxcode{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`{)}. |
90
+ | % \indexlibrary{\idxcode{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`{)}. |
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~ [[re.alg]] and iterators~ [[re.iter]]. |
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
  namespace regex_constants {
108
  typedef T3 error_type;
109
+ constexpr error_type error_collate = unspecified;
110
+ constexpr error_type error_ctype = unspecified;
111
+ constexpr error_type error_escape = unspecified;
112
+ constexpr error_type error_backref = unspecified;
113
+ constexpr error_type error_brack = unspecified;
114
+ constexpr error_type error_paren = unspecified;
115
+ constexpr error_type error_brace = unspecified;
116
+ constexpr error_type error_badbrace = unspecified;
117
+ constexpr error_type error_range = unspecified;
118
+ constexpr error_type error_space = unspecified;
119
+ constexpr error_type error_badrepeat = unspecified;
120
+ constexpr error_type error_complexity = unspecified;
121
+ constexpr error_type error_stack = unspecified;
122
  }
123
  }
124
  ```
125
 
126
  The type `error_type` is an *implementation-defined* enumerated type (