使用 use re debug 查看正則表達式的匹配過程
更新時間:2013年02月09日 23:44:13 作者:
使用 use re 'debug' 查看正則表達式的匹配過程,參見如下的代碼
復(fù)制代碼 代碼如下:
#!/usr/bin/perl
use strict;
use warnings;
use re 'debug';
sub test {
my $str = "123456789";
print join(":", split /(?<=...)/, $str);
}
test();
相關(guān)文章
perl pop push shift unshift實例介紹
perl的pop跟push操作數(shù)組的最右邊,shift跟unshift操作數(shù)組的最左邊2013-02-02