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