In Regexes§
See primary documentation in context for Exhaustive.
To find all possible matches of a regex – including overlapping ones – and several ones that start at the same position, use the :exhaustive
(short :ex
) adverb.
given 'abracadabra' { for m:exhaustive/ a .* a / -> $match { say ' ' x $match.from, ~$match; } }
The above code produces this output:
abracadabra abracada abraca abra acadabra acada aca adabra ada abra