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