@@ -44,9 +44,9 @@ operators:
44
44
$match = m/.+/; say $match; say $match.^name; # OUTPUT: «「abc」Match»
45
45
$match = /.+/; say $match; say $match.^name; # OUTPUT: «/.+/Regex»
46
46
47
- Whitespace in literal regexes is ignored insofar as the L < :sigspace
48
- adverb|/language/regexes#Sigspace > is not used to make whitespace syntactically
49
- significant.
47
+ Whitespace in literal regexes is ignored insofar as the
48
+ L < C < :sigspace > adverb|/language/regexes#Sigspace> is not used to make whitespace
49
+ syntactically significant.
50
50
51
51
In addition to whitespace, comments may be used inside of regexes to improve
52
52
their readability and comprehensibility just as in Perl6 code in general. This
@@ -262,12 +262,15 @@ Examples of word characters:
262
262
= end table
263
263
264
264
The predefined character classes in the leftmost column are all of the form
265
- C « <name> » , a hint to the fact that they are implemented as built-in L < named
266
- regexes|language/regexes#Subrules > . As such they are subject to the usual
267
- capturing semantics. This means, inter alia, that these classes do not only
268
- match, but also capture, installing a correspondingly named L < named
269
- capture|/language/regexes#Named_captures > in the resulting L < Match
270
- object|/type/Match > .
265
+ C « <name> » , a hint to the fact that they are implemented as built-in
266
+ L < named regexes|/language/regexes#Subrules > .
267
+ As such they are subject to the usual capturing semantics. This means that if
268
+ a character class is called with the syntax C « <name> » (i.e. as indicated in
269
+ the leftmost column), it will not only match, but also capture, installing a
270
+ correspondingly named L < named capture|/language/regexes#Named_captures > in the
271
+ resulting L < Match object|/type/Match > . In case just a match and no capture is
272
+ desired, the capture may be suppressed through the use of call syntax that
273
+ includes a leading dot: C « <.name> » .
271
274
272
275
Note that the character classes C « <same> » , C « <wb> » and C « <ww> » are so-called
273
276
zero-width assertions, which do not really match any character.
0 commit comments