1 小骆驼 第八章 用正则表达式进行匹配 2 3 #!/usr/bin/envperl 4 5 use strict; 6 use warnings; 7 8 $_ ="#adchbehnyhme3534f vdh5ejbnv _+IHG "; 9 10 if(m%(a)%){print "$1 ";}else{print "no match! ";} 11 12 if(/(i)/i){print "$1 ";}else{print "no match! ";} 13 14 if(/ad(.*)5e/s){print "$1 ";}else{print "no match! ";} 15 16 if(/ j(.*)v/x){print "$1 ";}else{print "no match! ";} 17 18 if(/ (.?)/sx){print "$1 ";}else{print "no match! ";} 19 20 if(/#(.*)/){print "$1 ";}else{print "no match! ";} 21 22 #a 23 #I 24 #chbehnyhme3534f 25 #vdh 26 #bn 27 # 28 #adchbehnyhme3534f