matching adverb :continue

Documentation for matching adverb :continue, assembled from the following types:

language documentation Regexes

From Regexes

(Regexes) matching adverb :continue

The :continue or short :c adverb takes an argument. The argument is the position where the regex should start to search. By default, it searches from the start of the string, but :c overrides that. If no position is specified for :c, it will default to 0 unless $/ is set, in which case, it defaults to $/.to.

given 'a1xa2' {
    say ~m/a./;         # OUTPUT: «a1␤» 
    say ~m:c(2)/a./;    # OUTPUT: «a2␤» 
}

Note: unlike :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␤»