From Jason Turner

[re.matchflag]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp8uocq2cq/{from.md → to.md} +34 -31
tmp/tmp8uocq2cq/{from.md → to.md} RENAMED
@@ -2,48 +2,51 @@
2
 
3
  ``` cpp
4
  namespace std {
5
  namespace regex_constants{
6
  typedef T2 match_flag_type;
7
- static constexpr match_flag_type match_default = 0
8
- static constexpr match_flag_type match_not_bol = unspecified;
9
- static constexpr match_flag_type match_not_eol = unspecified;
10
- static constexpr match_flag_type match_not_bow = unspecified;
11
- static constexpr match_flag_type match_not_eow = unspecified;
12
- static constexpr match_flag_type match_any = unspecified;
13
- static constexpr match_flag_type match_not_null = unspecified;
14
- static constexpr match_flag_type match_continuous = unspecified;
15
- static constexpr match_flag_type match_prev_avail = unspecified;
16
- static constexpr match_flag_type format_default = 0;
17
- static constexpr match_flag_type format_sed = unspecified;
18
- static constexpr match_flag_type format_no_copy = unspecified;
19
- static constexpr match_flag_type format_first_only = unspecified;
20
  }
21
  }
22
  ```
23
 
24
  The type `regex_constants::match_flag_type` is an implementation-defined
25
- bitmask type ([[bitmask.types]]). Matching a regular expression against
26
- a sequence of characters \[`first`, `last`) proceeds according to the
27
- rules of the grammar specified for the regular expression object,
28
- modified according to the effects listed in Table  [[tab:re:matchflag]]
29
- for any bitmask elements set.
 
 
 
30
 
31
  **Table: `regex_constants::match_flag_type` effects when obtaining a match against a
32
  character container sequence {[}`first`, `last`{)}.** <a id="tab:re:matchflag">[tab:re:matchflag]</a>
33
 
34
  | Element | Effect(s) if set |
35
- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
36
- | % \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`{)}. |
37
- | % \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`{)}. |
38
- | % \indexlibrary{\idxcode{match_not_bow}}% match_not_bow | The expression \verb|"\b"| shall not match the sub-sequence {[}`first`, `first`{)}. |
39
- | % \indexlibrary{\idxcode{match_not_eow}}% match_not_eow | The expression \verb|"\b"| shall not match the sub-sequence {[}`last`, `last`{)}. |
40
- | % \indexlibrary{\idxcode{match_any}}% match_any | If more than one match is possible then any match is an acceptable result. |
41
- | % \indexlibrary{\idxcode{match_not_null}}% match_not_null | The expression shall not match an empty sequence. |
42
- | % \indexlibrary{\idxcode{match_continuous}}% match_continuous | The expression shall only match a sub-sequence that begins at `first`. |
43
- | % \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]]. |
44
- | % \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. |
45
- | % \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. |
46
- | % \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. |
47
- | % \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. |
48
 
49
 
 
2
 
3
  ``` cpp
4
  namespace std {
5
  namespace regex_constants{
6
  typedef T2 match_flag_type;
7
+ constexpr match_flag_type match_default = {};
8
+ constexpr match_flag_type match_not_bol = unspecified;
9
+ constexpr match_flag_type match_not_eol = unspecified;
10
+ constexpr match_flag_type match_not_bow = unspecified;
11
+ constexpr match_flag_type match_not_eow = unspecified;
12
+ constexpr match_flag_type match_any = unspecified;
13
+ constexpr match_flag_type match_not_null = unspecified;
14
+ constexpr match_flag_type match_continuous = unspecified;
15
+ constexpr match_flag_type match_prev_avail = unspecified;
16
+ constexpr match_flag_type format_default = {};
17
+ constexpr match_flag_type format_sed = unspecified;
18
+ constexpr match_flag_type format_no_copy = unspecified;
19
+ constexpr match_flag_type format_first_only = unspecified;
20
  }
21
  }
22
  ```
23
 
24
  The type `regex_constants::match_flag_type` is an implementation-defined
25
+ bitmask type ([[bitmask.types]]). The constants of that type, except
26
+ for `match_default` and `format_default`, are bitmask elements. The
27
+ `match_default` and `format_default` constants are empty bitmasks.
28
+ Matching a regular expression against a sequence of characters
29
+ \[`first`, `last`) proceeds according to the rules of the grammar
30
+ specified for the regular expression object, modified according to the
31
+ effects listed in Table  [[tab:re:matchflag]] for any bitmask elements
32
+ set.
33
 
34
  **Table: `regex_constants::match_flag_type` effects when obtaining a match against a
35
  character container sequence {[}`first`, `last`{)}.** <a id="tab:re:matchflag">[tab:re:matchflag]</a>
36
 
37
  | Element | Effect(s) if set |
38
+ | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39
+ | % \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`{)}. |
40
+ | % \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`{)}. |
41
+ | % \indexlibrary{\idxcode{match_not_bow}}% `match_not_bow` | The expression \verb|"b"| shall not match the sub-sequence {[}`first`, `first`{)}. |
42
+ | % \indexlibrary{\idxcode{match_not_eow}}% `match_not_eow` | The expression \verb|"b"| shall not match the sub-sequence {[}`last`, `last`{)}. |
43
+ | % \indexlibrary{\idxcode{match_any}}% `match_any` | If more than one match is possible then any match is an acceptable result. |
44
+ | % \indexlibrary{\idxcode{match_not_null}}% `match_not_null` | The expression shall not match an empty sequence. |
45
+ | % \indexlibrary{\idxcode{match_continuous}}% `match_continuous` | The expression shall only match a sub-sequence that begins at `first`. |
46
+ | % \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]]. |
47
+ | % \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. |
48
+ | % \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. |
49
+ | % \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. |
50
+ | % \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. |
51
 
52