RosettaCodeData/Task/String-matching/Raku/string-matching-4.raku

3 lines
196 B
Raku
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
$haystack.match($needle, :g)».from; # List of all positions where $needle appears in $haystack
$haystack.indices($needle :overlap); # Also find any overlapping instances of $needle in $haystack