perl 取出正则表达式的匹配位置

my $a="1234567895";
while ($a=~/5/g) {
    my $p=pos($a);
    print "$p\n";
}

 

posted on 2013-04-01 19:26  云中道长  阅读(410)  评论(0编辑  收藏  举报

导航