@@ -320,7 +320,8 @@ abstract class RegExp extends Expr {
320
320
* Matches named character properties. For example:
321
321
* - `\p{Space}`
322
322
* - `\P{Digit}` upper-case P means inverted
323
- * - `\p{^Word}` caret also means inverted
323
+ * - `\p{^Word}` caret also means inverted (not supported in Swift `Regex` but it may be in
324
+ * other regex parsers or in future versions of Swift).
324
325
*
325
326
* These can occur both inside and outside of character classes.
326
327
*/
@@ -343,7 +344,8 @@ abstract class RegExp extends Expr {
343
344
/**
344
345
* Holds if the named character property is inverted. Examples for which it holds:
345
346
* - `\P{Digit}` upper-case P means inverted
346
- * - `\p{^Word}` caret also means inverted
347
+ * - `\p{^Word}` caret also means inverted (not supported in Swift `Regex` but it may be in
348
+ * other regex parsers or in future versions of Swift).
347
349
* - `[[:^digit:]]`
348
350
*
349
351
* Examples for which it doesn't hold:
@@ -381,8 +383,11 @@ abstract class RegExp extends Expr {
381
383
// wide hex char \uhhhh
382
384
this .getChar ( start + 1 ) = "u" and end = start + 6
383
385
or
386
+ // wide hex char \Uhhhhhhhh
387
+ this .getChar ( start + 1 ) = "U" and end = start + 10
388
+ or
384
389
// escape not handled above; update when adding a new case
385
- not this .getChar ( start + 1 ) in [ "x" , "u" ] and
390
+ not this .getChar ( start + 1 ) in [ "x" , "u" , "U" ] and
386
391
not exists ( this .getChar ( start + 1 ) .toInt ( ) ) and
387
392
end = start + 2
388
393
)
0 commit comments