Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add clarification for :pos/:continue
  • Loading branch information
zoffixznet committed Nov 9, 2016
1 parent aa0945b commit 8ddd8d1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/Language/regexes.pod6
Expand Up @@ -1111,6 +1111,12 @@ case it defaults to C<$/.to>.
say ~m:c(2)/a./; # a2
}
I<Note:> unlike C<:pos>, a match with :continue() will attempt, to
match further in the string, instead of failing:
say "abcdefg" ~~ m:c(3)/e.+/; # OUTPUT«「efg」␤»
say "abcdefg" ~~ m:p(3)/e.+/; # OUTPUT«False␤»
=head3 Exhaustive
To find all possible matches of a regex – including overlapping ones – and
Expand Down Expand Up @@ -1165,6 +1171,12 @@ Anchor the match at a specific position in the string:
C<:p> is shorthand for C<:pos>.
I<Note:> unlike C<:continue>, a match anchored with :pos() will fail,
instead of attempting to match further down the string:
say "abcdefg" ~~ m:c(3)/e.+/; # OUTPUT«「efg」␤»
say "abcdefg" ~~ m:p(3)/e.+/; # OUTPUT«False␤»
=head3 Overlap
To get several matches, including overlapping matches, but only one (the
Expand Down

0 comments on commit 8ddd8d1

Please sign in to comment.