programming-examples/perl/String/Using pos to display pattern match positions.pl
2019-11-15 12:59:38 +01:00

8 lines
165 B
Raku

#!/usr/local/bin/perl
$string = "Mississippi";
while ($string =~ /i/g) {
$position = pos($string);
print("matched at position $position\n");
}