Documentation for routine comb

Documentation for routine comb, assembled from the following types:

Str.comb

From Str

comb

multi sub    comb(Str:D   $matcher, Str:D $input, $limit = Inf, Bool :$match) 
multi sub    comb(Regex:D $matcher, Str:D $input, $limit = Inf, Bool :$match) 
multi method comb(Str:D $input:)
multi method comb(Str:D $input: Str:D   $matcher, $limit = Inf, Bool :$match) 
multi method comb(Str:D $input: Regex:D $matcher, $limit = Inf, Bool :$match) 

Searches for $matcher in $input and returns a list of all matches (as Str by default, or as Match if $match is True), limited to at most $limit matches.

If no matcher is supplied, a list of characters in the string (ie $delimiter = rx/./) is returned.

Examples:

comb(/\w/, "a;b;c").perl;        # ("a", "b", "c").list
comb(/\N/, "a;b;c").perl;        # ("a", ";", "b", ";", "c").list
comb(/\w/, "a;b;c", 2).perl;     # ("a", "b").list
comb(/\w\;\w/, "a;b;c", 2).perl; # ("a;b",).list