Skip to content

Commit 8ddd8d1

Browse files
authored
1 parent aa0945b commit 8ddd8d1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/Language/regexes.pod6

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,12 @@ case it defaults to C<$/.to>.
11111111
say ~m:c(2)/a./; # a2
11121112
}
11131113
1114+
I<Note:> unlike C<:pos>, a match with :continue() will attempt, to
1115+
match further in the string, instead of failing:
1116+
1117+
say "abcdefg" ~~ m:c(3)/e.+/; # OUTPUT«「efg」␤»
1118+
say "abcdefg" ~~ m:p(3)/e.+/; # OUTPUT«False␤»
1119+
11141120
=head3 Exhaustive
11151121
11161122
To find all possible matches of a regex – including overlapping ones – and
@@ -1165,6 +1171,12 @@ Anchor the match at a specific position in the string:
11651171
11661172
C<:p> is shorthand for C<:pos>.
11671173
1174+
I<Note:> unlike C<:continue>, a match anchored with :pos() will fail,
1175+
instead of attempting to match further down the string:
1176+
1177+
say "abcdefg" ~~ m:c(3)/e.+/; # OUTPUT«「efg」␤»
1178+
say "abcdefg" ~~ m:p(3)/e.+/; # OUTPUT«False␤»
1179+
11681180
=head3 Overlap
11691181
11701182
To get several matches, including overlapping matches, but only one (the

0 commit comments

Comments
 (0)