perl .*?和.*

redis01:/root# cat x2.pl 
my $str="212121a19823a456123";
if ($str =~/.*a(.*)23/){print "1----".$1."\n";};
if ($str =~/.*?a(.*)23/){print "2----".$1."\n";};
redis01:/root# perl x2.pl 
1----4561
2----19823a4561

posted @ 2016-07-04 13:42  czcb  阅读(193)  评论(0编辑  收藏  举报