1 #!/usr/bin/perl 2 3 use strict; 4 use warnings; 5 6 foreach(<>) 7 { 8 if (/(\w*)/a){print "$1\n";}else{print "no match\n";} 9 } 10 11 #11111111111111111111111111111111111 12 #nciuwbufcbew 13 # 14 #x 15 #xw 16 #11111111111111111111111111111111111 17 18 foreach(<>) 19 { 20 if (/(\w*)/l){print "$1\n";}else{print "no match\n";} 21 } 22 23 #11111111111111111111111111111111111 24 #nciuwbufcbew``````//.]];s[[..; 25 # 26 #x,dsncdk,;l,ex 27 #xw,eocxmcmck 28 #11111111111111111111111111111111111 29 30 foreach(<>) 31 { 32 if (/\Ax(.*)/){print "$1\n";}else{print "no match\n";} 33 } 34 35 #no match 36 #no match 37 #no match 38 #,ex 39 #w,eocxmcmck 40 #no match 41 42 foreach(<>) 43 { 44 if (/(.*)\;\z/){print "$1\n";}else{print "no match\n";} 45 } 46 47 #no match 48 #no match 49 #no match 50 #no match 51 #no match 52 #no match 53 54 foreach(<>) 55 { 56 if (/(.*)\;\Z/){print "$1\n";}else{print "no match\n";} 57 } 58 59 #no match 60 #nciuwbufcbew``````//.]];s[[.. 61 #no match 62 #no match 63 #no match 64 #no match 65 66 foreach(<>) 67 { 68 if (/\A(\s*)\Z/){print "$1\n";}else{print "no match\n";} 69 } 70 71 #no match 72 #no match 73 # 74 # 75 #no match 76 #no match 77 #no match 78 79 $_=‘ 80 81 oinn 82 nin 83 nin 84 kkkk‘; 85 86 if (/(.*)k$/){print "$1\n";}else{print "no match\n";} 87 88 # kkk 89 90 if (/^n(.*)/m){print "$1\n";}else{print "no match\n";} 91 92 #in
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。