was Re: [ID 19991102.003] perl on os390
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / regcomp
CommitLineData
599cee73 1 regcomp.c AOK
2
767a6a26 3 Strange *+?{} on zero-length expression [S_study_chunk]
4 /(?=a)?/
599cee73 5
767a6a26 6 %.*s matches null string many times [S_regpiece]
599cee73 7 $a = "ABC123" ; $a =~ /(?=a)*/'
8
767a6a26 9 /%.127s/: Unrecognized escape \\%c passed through" [S_regatom]
10 /\m/
599cee73 11
767a6a26 12 Character class syntax [. .] is reserved for future extensions [S_regpposixcc]
13
14 Character class syntax [= =] is reserved for future extensions [S_checkposixcc]
15
16 Character class syntax [%c %c] belongs inside character classes [S_checkposixcc]
17
73b437c8 18 /%.127s/: false [] range \"%*.*s\" in regexp [S_regclass]
599cee73 19
73b437c8 20 /%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8]
599cee73 21
1028017a 22 /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclass]
23
24 /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclassutf8]
25
599cee73 26__END__
767a6a26 27# regcomp.c [S_regpiece]
4438c4b7 28use warnings 'unsafe' ;
599cee73 29my $a = "ABC123" ;
30$a =~ /(?=a)*/ ;
4438c4b7 31no warnings 'unsafe' ;
0453d815 32$a =~ /(?=a)*/ ;
599cee73 33EXPECT
34(?=a)* matches null string many times at - line 4.
35########
767a6a26 36# regcomp.c [S_study_chunk]
4438c4b7 37use warnings 'unsafe' ;
599cee73 38$_ = "" ;
39/(?=a)?/;
4438c4b7 40no warnings 'unsafe' ;
0453d815 41/(?=a)?/;
599cee73 42EXPECT
43Strange *+?{} on zero-length expression at - line 4.
44########
767a6a26 45# regcomp.c [S_regatom]
46use warnings 'unsafe' ;
1028017a 47$a =~ /a\mb\b/ ;
767a6a26 48no warnings 'unsafe' ;
1028017a 49$a =~ /a\mb\b/ ;
767a6a26 50EXPECT
51Unrecognized escape \m passed through at - line 3.
52########
53# regcomp.c [S_regpposixcc S_checkposixcc]
4438c4b7 54use warnings 'unsafe' ;
599cee73 55$_ = "" ;
e8c223df 56/[:alpha:]/;
b8c5462f 57/[.bar.]/;
58/[=zog=]/;
e8c223df 59/[[:alpha:]]/;
60/[[.foo.]]/;
61/[[=bar=]]/;
62/[:zog:]/;
4438c4b7 63no warnings 'unsafe' ;
e8c223df 64/[:alpha:]/;
65/[.foo.]/;
66/[=bar=]/;
67/[[:alpha:]]/;
68/[[.foo.]]/;
69/[[=bar=]]/;
70/[:zog:]/;
71/[[:zog:]]/;
599cee73 72EXPECT
b8c5462f 73Character class syntax [: :] belongs inside character classes at - line 4.
74Character class syntax [. .] belongs inside character classes at - line 5.
75Character class syntax [. .] is reserved for future extensions at - line 5.
76Character class syntax [= =] belongs inside character classes at - line 6.
77Character class syntax [= =] is reserved for future extensions at - line 6.
e8c223df 78Character class syntax [. .] is reserved for future extensions at - line 8.
79Character class syntax [= =] is reserved for future extensions at - line 9.
80Character class syntax [: :] belongs inside character classes at - line 10.
81Character class [:zog:] unknown at - line 19.
73b437c8 82########
83# regcomp.c [S_regclass]
84$_ = "";
85use warnings 'unsafe' ;
86/[a-b]/;
87/[a-\d]/;
88/[\d-b]/;
89/[\s-\d]/;
90/[\d-\s]/;
91/[a-[:digit:]]/;
92/[[:digit:]-b]/;
93/[[:alpha:]-[:digit:]]/;
94/[[:digit:]-[:alpha:]]/;
95no warnings 'unsafe' ;
96/[a-b]/;
97/[a-\d]/;
98/[\d-b]/;
99/[\s-\d]/;
100/[\d-\s]/;
101/[a-[:digit:]]/;
102/[[:digit:]-b]/;
103/[[:alpha:]-[:digit:]]/;
104/[[:digit:]-[:alpha:]]/;
105EXPECT
106/[a-\d]/: false [] range "a-\d" in regexp at - line 5.
107/[\d-b]/: false [] range "\d-" in regexp at - line 6.
108/[\s-\d]/: false [] range "\s-" in regexp at - line 7.
109/[\d-\s]/: false [] range "\d-" in regexp at - line 8.
110/[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 9.
111/[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 10.
112/[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 11.
113/[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 12.
114########
115# regcomp.c [S_regclassutf8]
116use utf8;
117$_ = "";
118use warnings 'unsafe' ;
119/[a-b]/;
120/[a-\d]/;
121/[\d-b]/;
122/[\s-\d]/;
123/[\d-\s]/;
124/[a-[:digit:]]/;
125/[[:digit:]-b]/;
126/[[:alpha:]-[:digit:]]/;
127/[[:digit:]-[:alpha:]]/;
128no warnings 'unsafe' ;
129/[a-b]/;
130/[a-\d]/;
131/[\d-b]/;
132/[\s-\d]/;
133/[\d-\s]/;
134/[a-[:digit:]]/;
135/[[:digit:]-b]/;
136/[[:alpha:]-[:digit:]]/;
137/[[:digit:]-[:alpha:]]/;
138EXPECT
139/[a-\d]/: false [] range "a-\d" in regexp at - line 6.
140/[\d-b]/: false [] range "\d-" in regexp at - line 7.
141/[\s-\d]/: false [] range "\s-" in regexp at - line 8.
142/[\d-\s]/: false [] range "\d-" in regexp at - line 9.
143/[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 10.
144/[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 11.
145/[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 12.
146/[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 13.
1028017a 147########
148# regcomp.c [S_regclass S_regclassutf8]
149use warnings 'unsafe' ;
150$a =~ /[a\zb]/ ;
151no warnings 'unsafe' ;
152$a =~ /[a\zb]/ ;
153EXPECT
154/[a\zb]/: Unrecognized escape \z in character class passed through at - line 3.