String matching: Difference between revisions
Content added Content deleted
m (→{{header|Tailspin}}: syntax update) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: multiple matches with 'indices') |
||
Line 2,773: | Line 2,773: | ||
Bonus task: |
Bonus task: |
||
<lang perl6>$haystack.match($needle, :g)».from; # List of all positions where $needle appears in $haystack |
<lang perl6>$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</lang> |
|||
=={{header|Phix}}== |
=={{header|Phix}}== |