摘要:
#!/usr/bin/perlforeach ( qw(fred betty barney dino)){ if (/fred|barney/){ print "$_ matched\n"; }} 阅读全文
摘要:
#!/usr/bin/perl$string="guoshun is a good shun a good";$string=~m/guoshun(.+?)good/;#默认的是贪心匹配 用?将贪心匹配变成非贪心匹配 所以输出的结果就是 is a print "$1\n";$string=~/guo 阅读全文