c:\@Work\Perl>perl -wMstrict -le "use Data::Dump qw(pp); ;; my $s = 'abCdefC'; print '01234567'; print $s; print '------------'; ;; while ($s =~ / (f)*? C /gx) { printf qq{matched (f) of %s then C at pos of %d \n}, pp($1), pos $s; } ;; print '------------'; ;; while ($s =~ / (f*?) C /gx) { printf qq{matched (f) of %s then C at pos of %d \n}, pp($1), pos $s; } " 01234567 abCdefC ------------ matched (f) of undef then C at pos of 3 matched (f) of "f" then C at pos of 7 ------------ matched (f) of "" then C at pos of 3 matched (f) of "f" then C at pos of 7