In Regexes§
See primary documentation in context for Pos
Anchor the match at a specific position in the string:
given 'abcdef'
:p
is shorthand for :pos
.
Note: unlike :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»