Skip to content

Commit 69cdc07

Browse files
authored
Add type constrains to speed up examples
MasterDuke17++ It should be nice if keep using effective code in examples.
1 parent 94bdf62 commit 69cdc07

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/Language/regexes.pod6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,10 +1264,10 @@ There are four ways you can interpolate a string into regex as a pattern.
12641264
That is using C«$pattern», C«$($pattern)», C«<$pattern>» or
12651265
C«<{$pattern.method}>».
12661266
1267-
my $text = 'camelia';
1268-
my $pattern0 = 'camelia';
1269-
my $pattern1 = 'ailemac';
1270-
my $pattern2 = '\w+';
1267+
my Str $text = 'camelia';
1268+
my Str $pattern0 = 'camelia';
1269+
my Str $pattern1 = 'ailemac';
1270+
my Str $pattern2 = '\w+';
12711271
12721272
say $text ~~ / $pattern0 /; # OUTPUT: «「camelia」␤»
12731273
say $text ~~ / $($pattern0) /; # OUTPUT: «「camelia」␤»

0 commit comments

Comments
 (0)