$|^|\z|\Z|/a|/l

 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 #,dsncdk,;l,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

猜你喜欢

转载自www.cnblogs.com/yuanjingnan/p/11070607.html
z