Skip to content

Commit d42c110

Browse files
Amendments
1 parent bc1ad97 commit d42c110

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

doc/Language/regexes.pod6

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ operators:
4444
$match = m/.+/; say $match; say $match.^name; # OUTPUT: «「abc」␤Match␤»
4545
$match = /.+/; say $match; say $match.^name; # OUTPUT: «/.+/␤Regex␤»
4646
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.
5050
5151
In addition to whitespace, comments may be used inside of regexes to improve
5252
their readability and comprehensibility just as in Perl6 code in general. This
@@ -262,12 +262,15 @@ Examples of word characters:
262262
=end table
263263
264264
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>».
271274
272275
Note that the character classes C«<same>», C«<wb>» and C«<ww>» are so-called
273276
zero-width assertions, which do not really match any character.

0 commit comments

Comments
 (0)