Skip to content

Commit a5d932d

Browse files
authored
first call to show_captures has wrong number of arguments in section Backtracking
In the first example where show_captures is defined, the call to it has also $string as its second argument(line 1937). this is not used in the sub signature. Furthermore a small typo on line 1917 (matched instead of match).
1 parent 6229a9e commit a5d932d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/Language/regexes.pod6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@ my $string = 'PostgreSQL is an SQL database!';
19141914
say $string ~~ /(.+)(SQL) (.+) $1/; # OUTPUT: 「PostgreSQL is an SQL」
19151915
=end code
19161916
1917-
What happens in the above example is that the string has to be match against the
1917+
What happens in the above example is that the string has to be matched against the
19181918
second occurrence of the word I<SQL>, eating all characters before and leaving out
19191919
the rest.
19201920
@@ -1934,7 +1934,7 @@ sub show_captures( Match $m ){
19341934
say $result_split;
19351935
}
19361936
1937-
$string ~~ /(.+)(SQL) (.+) $1 (.+) { show_captures( $/, $string ); }/;
1937+
$string ~~ /(.+)(SQL) (.+) $1 (.+) { show_captures( $/ ); }/;
19381938
=end code
19391939
19401940
The C<show_captures> method will dump all the elements of C<$/> producing

0 commit comments

Comments
 (0)