syntax :exhaustive

Documentation for syntax :exhaustive assembled from the following types:

language documentation Regexes

From Regexes

(Regexes) matching adverb :exhaustive :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