Skip to content

Commit

Permalink
make example classier
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrowder committed Aug 13, 2019
1 parent 70fb14a commit f06c83c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/Language/regexes.pod6
Expand Up @@ -1751,7 +1751,7 @@ the target regex to assume the form C</$variable2/>. As described above, the
evaluation of this regex will then trigger further interpolation of
C<$variable2>:
my $string = Q[Mindfuck \w+ $variable1 $variable2];
my $string = Q[Mindless \w+ $variable1 $variable2];
my $variable1 = Q[\w+];
my $variable2 = Q[$variable1];
my sub f1 { return Q[$variable2] };
Expand All @@ -1763,7 +1763,7 @@ C<$variable2>:
say $string.match: /<$variable2>/; # OUTPUT: 「\w+」
# /<$variable1>/ ==> /\w+/
say $string.match: /<$variable1>/; # OUTPUT: 「Mindfuck
say $string.match: /<$variable1>/; # OUTPUT: 「Mindless
When an array variable is interpolated into a regex, the regex engine handles it
like a C<|> alternative of the regex elements (see the documentation on
Expand Down

0 comments on commit f06c83c

Please sign in to comment.