You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cpp2/metafunctions.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -374,7 +374,7 @@ A `cpp1_rule_of_zero` type is one that has no user-written copy/move/destructor
374
374
375
375
#### `regex`
376
376
377
-
Replaces fields in the class with regular expression objects. Each field starting with `regex` is replaced with a regular expression of the same type.
377
+
Replaces fields in the class with regular expression objects. All fields named `regex` or starting with `regex_` are replaced with a regular expression of the same type.
The regex syntax used by cppfront is the [perl syntax](https://perldoc.perl.org/perlre). Most of the syntax is available. Currently we do not support unicode characters and the syntax tokens associated with them. In [supported features](../other/regex_status.md) all the available regex syntax is listed.
Copy file name to clipboardExpand all lines: docs/other/regex_status.md
+32-32
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The listings are taken from [perl regex docs](https://perldoc.perl.org/perlre).
10
10
- [x] m Treat the string being matched against as multiple lines. That is, change "^" and "$" from matching the start of the string's first line and the end of its last line to matching the start and end of each line within the string.
11
11
- [x] s Treat the string as single line. That is, change "." to match any character whatsoever, even a newline, which normally it would not match.
12
12
- [x] x and xx Extend your pattern's legibility by permitting whitespace and comments. Details in "/x and /xx"
13
-
- [x] n Prevent the grouping metacharacters () from capturing. This modifier, new in 5.22, will stop $1, $2, etc... from being filled in.
13
+
- [x] n Prevent the grouping metacharacters () from capturing. This modifier will stop $1, $2, etc... from being filled in.
14
14
- [ ] c keep the current position during repeated matching
15
15
```
16
16
@@ -54,37 +54,37 @@ The listings are taken from [perl regex docs](https://perldoc.perl.org/perlre).
54
54
55
55
### Character Classes and other Special Escapes __(Complete)__
56
56
```
57
-
- [x] [...] [1] Match a character according to the rules of the
57
+
- [x] [...] Match a character according to the rules of the
58
58
bracketed character class defined by the "...".
59
59
Example: [a-z] matches "a" or "b" or "c" ... or "z"
60
-
- [x] [[:...:]] [2] Match a character according to the rules of the POSIX
60
+
- [x] [[:...:]] Match a character according to the rules of the POSIX
61
61
character class "..." within the outer bracketed
62
62
character class. Example: [[:upper:]] matches any
63
63
uppercase character.
64
-
- [x] \g1 [5] Backreference to a specific or previous group,
65
-
- [x] \g{-1} [5] The number may be negative indicating a relative
66
-
previous group and may optionally be wrapped in
67
-
curly brackets for safer parsing.
68
-
- [x] \g{name} [5] Named backreference
69
-
- [x] \k<name> [5] Named backreference
70
-
- [x] \k'name' [5] Named backreference
71
-
- [x] \k{name} [5] Named backreference
72
-
- [x] \w [3] Match a "word" character (alphanumeric plus "_", plus
64
+
- [x] \g1 Backreference to a specific or previous group,
65
+
- [x] \g{-1} The number may be negative indicating a relative
66
+
previous group and may optionally be wrapped in
67
+
curly brackets for safer parsing.
68
+
- [x] \g{name} Named backreference
69
+
- [x] \k<name> Named backreference
70
+
- [x] \k'name' Named backreference
71
+
- [x] \k{name} Named backreference
72
+
- [x] \w Match a "word" character (alphanumeric plus "_", plus
73
73
other connector punctuation chars plus Unicode
74
74
marks)
75
-
- [x] \W [3] Match a non-"word" character
76
-
- [x] \s [3] Match a whitespace character
77
-
- [x] \S [3] Match a non-whitespace character
78
-
- [x] \d [3] Match a decimal digit character
79
-
- [x] \D [3] Match a non-digit character
80
-
- [x] \v [3] Vertical whitespace
81
-
- [x] \V [3] Not vertical whitespace
82
-
- [x] \h [3] Horizontal whitespace
83
-
- [x] \H [3] Not horizontal whitespace
84
-
- [x] \1 [5] Backreference to a specific capture group or buffer.
75
+
- [x] \W Match a non-"word" character
76
+
- [x] \s Match a whitespace character
77
+
- [x] \S Match a non-whitespace character
78
+
- [x] \d Match a decimal digit character
79
+
- [x] \D Match a non-digit character
80
+
- [x] \v Vertical whitespace
81
+
- [x] \V Not vertical whitespace
82
+
- [x] \h Horizontal whitespace
83
+
- [x] \H Not horizontal whitespace
84
+
- [x] \1 Backreference to a specific capture group or buffer.
85
85
'1' may actually be any positive integer.
86
-
- [x] \N [7] Any character but \n. Not affected by /s modifier
87
-
- [x] \K [6] Keep the stuff left of the \K, don't include it in $&
86
+
- [x] \N Any character but \n. Not affected by /s modifier
87
+
- [x] \K Keep the stuff left of the \K, don't include it in $&
88
88
```
89
89
90
90
### Assertions
@@ -95,7 +95,7 @@ The listings are taken from [perl regex docs](https://perldoc.perl.org/perlre).
95
95
- [x] \Z Match only at end of string, or before newline at the end
96
96
- [x] \z Match only at end of string
97
97
- [ ] \G Match only at pos() (e.g. at the end-of-match position
98
-
of prior m//g)
98
+
of prior m//g)
99
99
```
100
100
101
101
### Capture groups __(Complete)__
@@ -157,7 +157,7 @@ The listings are taken from [perl regex docs](https://perldoc.perl.org/perlre).
157
157
### Modifiers
158
158
```
159
159
- [ ] p Preserve the string matched such that ${^PREMATCH}, ${^MATCH}, and ${^POSTMATCH} are available for use after matching.
160
-
- [ ] a, d, l, and u These modifiers, all new in 5.14, affect which character-set rules (Unicode, etc.) are used, as described below in "Character set modifiers".
160
+
- [ ] a, d, l, and u These modifiers affect which character-set rules (Unicode, etc.) are used, as described below in "Character set modifiers".
161
161
- [ ] g globally match the pattern repeatedly in the string
162
162
- [ ] e evaluate the right-hand side as an expression
163
163
- [ ] ee evaluate the right side as a string then eval the result
@@ -180,11 +180,11 @@ The listings are taken from [perl regex docs](https://perldoc.perl.org/perlre).
180
180
181
181
### Character Classes and other Special Escapes
182
182
```
183
-
- [ ] (?[...]) [8] Extended bracketed character class
184
-
- [ ] \pP [3] Match P, named property. Use \p{Prop} for longer names
185
-
- [ ] \PP [3] Match non-P
186
-
- [ ] \X [4] Match Unicode "eXtended grapheme cluster"
187
-
- [ ] \R [4] Linebreak
183
+
- [ ] (?[...]) Extended bracketed character class
184
+
- [ ] \pP Match P, named property. Use \p{Prop} for longer names
185
+
- [ ] \PP Match non-P
186
+
- [ ] \X Match Unicode "eXtended grapheme cluster"
187
+
- [ ] \R Linebreak
188
188
```
189
189
190
190
### Assertions
@@ -208,4 +208,4 @@ The listings are taken from [perl regex docs](https://perldoc.perl.org/perlre).
208
208
- [ ] (*sr:pattern) All chars in pattern need to be of the same script.
209
209
- [ ] (*atomic_script_run:pattern) Without backtracking.
0 commit comments