# Repetition quantifier is ** my $str = "mememememe"; if $str ~~ m/ [me|meme] ** 2 / { # | matches greedily say "Matched '$/'"; } if $str ~~ m/ 'me' ** 2..4 / { # Match 'me' two to four times say "Matched '$/'"; }
Instead of representing temporal alternation, | now represents logical
alternation with declarative longest-token semantics. (You may now use
|| to indicate the old temporal alternation. That is, | and || now work
within regex syntax much the same as they do outside of regex syntax,
where they represent junctional and short-circuit OR. This includes the
fact that | has tighter precedence than ||.)
via http://www.perlcabal.org/syn/S05.html#Longest-token_matching