in reply to perl indication of end of string already matched
Maybe I am simplistic, but this works:
my $str = "abc"; while ($str =~ m/.(?=.|$)/gc) { say "1: ", pos $str; } while ($str =~ m/.(?=.|$)/gc) { say "2: ", pos $str; } [download]