Commit | Line | Data |
599cee73 |
1 | regcomp.c AOK |
2 | |
f9373011 |
3 | Quantifier unexpected on zero-length expression [S_study_chunk] |
4 | |
5 | (?p{}) is deprecated - use (??{}) [S_reg] |
6 | $a =~ /(?p{'x'})/ ; |
7 | |
8 | |
9 | Useless (%s%c) - %suse /%c modifier [S_reg] |
10 | Useless (%sc) - %suse /gc modifier [S_reg] |
11 | |
12 | |
13 | |
767a6a26 |
14 | Strange *+?{} on zero-length expression [S_study_chunk] |
15 | /(?=a)?/ |
599cee73 |
16 | |
767a6a26 |
17 | %.*s matches null string many times [S_regpiece] |
599cee73 |
18 | $a = "ABC123" ; $a =~ /(?=a)*/' |
19 | |
ac561586 |
20 | /%.127s/: Unrecognized escape \\%c passed through [S_regatom] |
e476b1b5 |
21 | $x = '\m' ; /$x/ |
599cee73 |
22 | |
f9373011 |
23 | POSIX syntax [%c %c] is reserved for future extensions [S_checkposixcc] |
24 | |
25 | |
ac561586 |
26 | Character class [:%.*s:] unknown [S_regpposixcc] |
27 | |
767a6a26 |
28 | Character class syntax [%c %c] belongs inside character classes [S_checkposixcc] |
29 | |
73b437c8 |
30 | /%.127s/: false [] range \"%*.*s\" in regexp [S_regclass] |
599cee73 |
31 | |
73b437c8 |
32 | /%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8] |
599cee73 |
33 | |
1028017a |
34 | /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclass] |
35 | |
36 | /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclassutf8] |
37 | |
f9373011 |
38 | False [] range \"%*.*s\" [S_regclass] |
39 | |
599cee73 |
40 | __END__ |
767a6a26 |
41 | # regcomp.c [S_regpiece] |
e476b1b5 |
42 | use warnings 'regexp' ; |
599cee73 |
43 | my $a = "ABC123" ; |
44 | $a =~ /(?=a)*/ ; |
e476b1b5 |
45 | no warnings 'regexp' ; |
0453d815 |
46 | $a =~ /(?=a)*/ ; |
599cee73 |
47 | EXPECT |
7253e4e3 |
48 | (?=a)* matches null string many times in regex; marked by <-- HERE in m/(?=a)* <-- HERE / at - line 4. |
599cee73 |
49 | ######## |
767a6a26 |
50 | # regcomp.c [S_study_chunk] |
e476b1b5 |
51 | use warnings 'regexp' ; |
599cee73 |
52 | $_ = "" ; |
53 | /(?=a)?/; |
e476b1b5 |
54 | no warnings 'regexp' ; |
0453d815 |
55 | /(?=a)?/; |
599cee73 |
56 | EXPECT |
7253e4e3 |
57 | Quantifier unexpected on zero-length expression in regex; marked by <-- HERE in m/(?=a)? <-- HERE / at - line 4. |
599cee73 |
58 | ######## |
767a6a26 |
59 | # regcomp.c [S_regatom] |
e476b1b5 |
60 | $x = '\m' ; |
61 | use warnings 'regexp' ; |
62 | $a =~ /a$x/ ; |
63 | no warnings 'regexp' ; |
64 | $a =~ /a$x/ ; |
767a6a26 |
65 | EXPECT |
7253e4e3 |
66 | Unrecognized escape \m passed through in regex; marked by <-- HERE in m/a\m <-- HERE / at - line 4. |
767a6a26 |
67 | ######## |
68 | # regcomp.c [S_regpposixcc S_checkposixcc] |
7f01dc7a |
69 | # |
e476b1b5 |
70 | use warnings 'regexp' ; |
599cee73 |
71 | $_ = "" ; |
e8c223df |
72 | /[:alpha:]/; |
e8c223df |
73 | /[:zog:]/; |
ac561586 |
74 | /[[:zog:]]/; |
e476b1b5 |
75 | no warnings 'regexp' ; |
e8c223df |
76 | /[:alpha:]/; |
ac561586 |
77 | /[:zog:]/; |
3802429d |
78 | /[[:zog:]]/; |
599cee73 |
79 | EXPECT |
7253e4e3 |
80 | POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:alpha:] <-- HERE / at - line 5. |
81 | POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:zog:] <-- HERE / at - line 6. |
82 | POSIX class [:zog:] unknown in regex; marked by <-- HERE in m/[[:zog:] <-- HERE ]/ |
3802429d |
83 | ######## |
84 | # regcomp.c [S_checkposixcc] |
7f01dc7a |
85 | # |
3802429d |
86 | use warnings 'regexp' ; |
87 | $_ = "" ; |
88 | /[.zog.]/; |
89 | no warnings 'regexp' ; |
90 | /[.zog.]/; |
91 | EXPECT |
7253e4e3 |
92 | POSIX syntax [. .] belongs inside character classes in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5. |
93 | POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[.zog.] <-- HERE / |
3802429d |
94 | ######## |
95 | # regcomp.c [S_checkposixcc] |
7f01dc7a |
96 | # |
3802429d |
97 | use warnings 'regexp' ; |
98 | $_ = "" ; |
99 | /[[.zog.]]/; |
100 | no warnings 'regexp' ; |
101 | /[[.zog.]]/; |
102 | EXPECT |
7253e4e3 |
103 | POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[[.zog.] <-- HERE ]/ |
73b437c8 |
104 | ######## |
105 | # regcomp.c [S_regclass] |
106 | $_ = ""; |
e476b1b5 |
107 | use warnings 'regexp' ; |
73b437c8 |
108 | /[a-b]/; |
109 | /[a-\d]/; |
110 | /[\d-b]/; |
111 | /[\s-\d]/; |
112 | /[\d-\s]/; |
113 | /[a-[:digit:]]/; |
114 | /[[:digit:]-b]/; |
115 | /[[:alpha:]-[:digit:]]/; |
116 | /[[:digit:]-[:alpha:]]/; |
e476b1b5 |
117 | no warnings 'regexp' ; |
73b437c8 |
118 | /[a-b]/; |
119 | /[a-\d]/; |
120 | /[\d-b]/; |
121 | /[\s-\d]/; |
122 | /[\d-\s]/; |
123 | /[a-[:digit:]]/; |
124 | /[[:digit:]-b]/; |
125 | /[[:alpha:]-[:digit:]]/; |
126 | /[[:digit:]-[:alpha:]]/; |
127 | EXPECT |
7253e4e3 |
128 | False [] range "a-\d" in regex; marked by <-- HERE in m/[a-\d <-- HERE ]/ at - line 5. |
129 | False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE b]/ at - line 6. |
130 | False [] range "\s-" in regex; marked by <-- HERE in m/[\s- <-- HERE \d]/ at - line 7. |
131 | False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE \s]/ at - line 8. |
132 | False [] range "a-[:digit:]" in regex; marked by <-- HERE in m/[a-[:digit:] <-- HERE ]/ at - line 9. |
133 | False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE b]/ at - line 10. |
134 | False [] range "[:alpha:]-" in regex; marked by <-- HERE in m/[[:alpha:]- <-- HERE [:digit:]]/ at - line 11. |
135 | False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE [:alpha:]]/ at - line 12. |
73b437c8 |
136 | ######## |
137 | # regcomp.c [S_regclassutf8] |
59af8754 |
138 | BEGIN { |
139 | if (ord("\t") == 5) { |
140 | print "SKIPPED\n# ebcdic regular expression ranges differ."; |
141 | exit 0; |
142 | } |
143 | } |
73b437c8 |
144 | use utf8; |
145 | $_ = ""; |
e476b1b5 |
146 | use warnings 'regexp' ; |
73b437c8 |
147 | /[a-b]/; |
148 | /[a-\d]/; |
149 | /[\d-b]/; |
150 | /[\s-\d]/; |
151 | /[\d-\s]/; |
152 | /[a-[:digit:]]/; |
153 | /[[:digit:]-b]/; |
154 | /[[:alpha:]-[:digit:]]/; |
155 | /[[:digit:]-[:alpha:]]/; |
e476b1b5 |
156 | no warnings 'regexp' ; |
73b437c8 |
157 | /[a-b]/; |
158 | /[a-\d]/; |
159 | /[\d-b]/; |
160 | /[\s-\d]/; |
161 | /[\d-\s]/; |
162 | /[a-[:digit:]]/; |
163 | /[[:digit:]-b]/; |
164 | /[[:alpha:]-[:digit:]]/; |
165 | /[[:digit:]-[:alpha:]]/; |
166 | EXPECT |
7253e4e3 |
167 | False [] range "a-\d" in regex; marked by <-- HERE in m/[a-\d <-- HERE ]/ at - line 12. |
168 | False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE b]/ at - line 13. |
169 | False [] range "\s-" in regex; marked by <-- HERE in m/[\s- <-- HERE \d]/ at - line 14. |
170 | False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE \s]/ at - line 15. |
171 | False [] range "a-[:digit:]" in regex; marked by <-- HERE in m/[a-[:digit:] <-- HERE ]/ at - line 16. |
172 | False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE b]/ at - line 17. |
173 | False [] range "[:alpha:]-" in regex; marked by <-- HERE in m/[[:alpha:]- <-- HERE [:digit:]]/ at - line 18. |
174 | False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE [:alpha:]]/ at - line 19. |
1028017a |
175 | ######## |
176 | # regcomp.c [S_regclass S_regclassutf8] |
e476b1b5 |
177 | use warnings 'regexp' ; |
1028017a |
178 | $a =~ /[a\zb]/ ; |
e476b1b5 |
179 | no warnings 'regexp' ; |
1028017a |
180 | $a =~ /[a\zb]/ ; |
181 | EXPECT |
7253e4e3 |
182 | Unrecognized escape \z in character class passed through in regex; marked by <-- HERE in m/[a\z <-- HERE b]/ at - line 3. |
b45f050a |
183 | |
f9373011 |
184 | ######## |
185 | # regcomp.c [S_study_chunk] |
186 | use warnings 'deprecated' ; |
187 | $a = "xx" ; |
188 | $a =~ /(?p{'x'})/ ; |
189 | no warnings ; |
190 | use warnings 'regexp' ; |
191 | $a =~ /(?p{'x'})/ ; |
192 | use warnings; |
193 | no warnings 'deprecated' ; |
194 | no warnings 'regexp' ; |
195 | $a =~ /(?p{'x'})/ ; |
196 | EXPECT |
197 | (?p{}) is deprecated - use (??{}) in regex; marked by <-- HERE in m/(?p <-- HERE {'x'})/ at - line 4. |
198 | (?p{}) is deprecated - use (??{}) in regex; marked by <-- HERE in m/(?p <-- HERE {'x'})/ at - line 7. |
199 | ######## |
200 | # regcomp.c [S_reg] |
201 | use warnings 'regexp' ; |
202 | $a = qr/(?c)/; |
203 | $a = qr/(?-c)/; |
204 | $a = qr/(?g)/; |
205 | $a = qr/(?-g)/; |
206 | $a = qr/(?o)/; |
207 | $a = qr/(?-o)/; |
208 | $a = qr/(?g-o)/; |
209 | $a = qr/(?g-c)/; |
210 | $a = qr/(?o-cg)/; # (?c) means (?g) error won't be thrown |
211 | $a = qr/(?ogc)/; |
212 | no warnings 'regexp' ; |
213 | $a = qr/(?c)/; |
214 | $a = qr/(?-c)/; |
215 | $a = qr/(?g)/; |
216 | $a = qr/(?-g)/; |
217 | $a = qr/(?o)/; |
218 | $a = qr/(?-o)/; |
219 | $a = qr/(?g-o)/; |
220 | $a = qr/(?g-c)/; |
221 | $a = qr/(?o-cg)/; # (?c) means (?g) error won't be thrown |
222 | $a = qr/(?ogc)/; |
223 | #EXPECT |
224 | EXPECT |
225 | Useless (?c) - use /gc modifier in regex; marked by <-- HERE in m/(?c <-- HERE )/ at - line 3. |
226 | Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?-c <-- HERE )/ at - line 4. |
227 | Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE )/ at - line 5. |
228 | Useless (?-g) - don't use /g modifier in regex; marked by <-- HERE in m/(?-g <-- HERE )/ at - line 6. |
229 | Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE )/ at - line 7. |
230 | Useless (?-o) - don't use /o modifier in regex; marked by <-- HERE in m/(?-o <-- HERE )/ at - line 8. |
231 | Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE -o)/ at - line 9. |
232 | Useless (?-o) - don't use /o modifier in regex; marked by <-- HERE in m/(?g-o <-- HERE )/ at - line 9. |
233 | Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE -c)/ at - line 10. |
234 | Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?g-c <-- HERE )/ at - line 10. |
235 | Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE -cg)/ at - line 11. |
236 | Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?o-c <-- HERE g)/ at - line 11. |
237 | Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE gc)/ at - line 12. |
238 | Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?og <-- HERE c)/ at - line 12. |
239 | Useless (?c) - use /gc modifier in regex; marked by <-- HERE in m/(?ogc <-- HERE )/ at - line 12. |