@@ -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
@@ -261,9 +261,19 @@ Examples of word characters:
261
261
262
262
= end table
263
263
264
- Note that the character classes C « <same> » , C « <wb> » and C « <ww> » are
265
- so called zero-width assertions, which do not really match a
266
- character.
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
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> » .
274
+
275
+ Note that the character classes C « <same> » , C « <wb> » and C « <ww> » are so-called
276
+ zero-width assertions, which do not really match any character.
267
277
268
278
= head2 X « Unicode properties|regex,<:property> »
269
279
@@ -1250,7 +1260,7 @@ all named captures:
1250
1260
}
1251
1261
1252
1262
A more convenient way to get named captures is by using named regex as discussed in
1253
- the L < Subrules|#Subrules > section.
1263
+ the L < Subrules|/language/regexes #Subrules > section.
1254
1264
1255
1265
= head2 X « Capture markers: C « <( )> » |regex,<( )> »
1256
1266
0 commit comments