RosettaCodeData/Task/String-matching/Perl/string-matching-4.pl

2 lines
64 B
Perl

print $-[0], "\n" while $str1 =~ /\Q$str2\E/g; # using a regex