Skip to content

Commit 2b7895b

Browse files
committed
Make xtest pass
1 parent f99445f commit 2b7895b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/Type/Str.pod6

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -830,20 +830,20 @@ of type L<Cool> are coerced to C<Str> for literal matching.
830830
831831
The replacement can be a L<Callable> in which the current L<Match> object will be
832832
placed in the C<$/> variable, as well as the C<$_> topic variable.
833-
No thunking of arguments is done, so you need to use a L<Callable> replacement, to
834-
refer to any of the captures made in the regex:
833+
Using a L<Callable> as replacement is how you can refer to any of the captures
834+
created in the regex:
835835
836836
# Using capture from $/ variable (the $0 is the first positional capture)
837837
say 'abc123defg'.subst(/(\d+)/, { " before $0 after " });
838838
# OUTPUT: «abc before 123 after defg␤»
839-
839+
840840
# Using capture from $/ variable (the $<foo> is a named capture)
841-
say 'abc123defg'.subst(/$<foo=\d+/, { " before $<foo> after " });
841+
say 'abc123defg'.subst(/$<foo>=\d+/, { " before $<foo> after " });
842842
# OUTPUT: «abc before 123 after defg␤»
843-
843+
844844
# Using WhateverCode to operate on the Match given in $_:
845-
say "abc123defg".subst(/(\d+)/, *.flip);
846-
# OUTPUT: «abc321defg␤»
845+
say 'abc123defg'.subst(/(\d+)/, "[ " ~ *.flip ~ " ]");
846+
# OUTPUT: «abc[ 321 ]defg␤»
847847
848848
# Using a Callable to generate substitution without involving current Match:
849849
my $i = 41;

0 commit comments

Comments
 (0)