模式测试程序

#/usr/bin/perl
use 5.010;

while(<>){
    chomp;
    if (/YOUR_PATTERN_GOES_HERE/) {
        say "${^PREMATCH}|${^MATCH}|${^POSTMATCH}";
     } else {
         say "No match:   |$_|\n";
     }

}
posted @ 2013-09-13 11:15  新闻官  阅读(136)  评论(0编辑  收藏  举报