返回列表 发帖

[原创代码] 【练习-023】按要求替换文本字符

本帖最后由 sxw 于 2011-10-22 23:27 编辑
#!/usr/bin/perl
use strict;
use warnings;
while(<DATA>) {
     next if /^330\d\d5/;
     $_=~s/33(\d\d)(\d\d)/20$1年$2月/g;  
print;
}
__DATA__
330001--330002--330106
330001--330006--330108
330001--330007--330112
330101--330108--330205
330101--330110--330212
330201--330211--330301
330302--330304--330309
330302--330308--330402
330302--330410--330408
330402--330406--330411
330505--330511--330807COPY

返回列表