Commit | Line | Data |
---|---|---|
599cee73 PM |
1 | regcomp.c AOK |
2 | ||
f9373011 PM |
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 PM |
14 | Strange *+?{} on zero-length expression [S_study_chunk] |
15 | /(?=a)?/ | |
599cee73 | 16 | |
767a6a26 | 17 | %.*s matches null string many times [S_regpiece] |
599cee73 PM |
18 | $a = "ABC123" ; $a =~ /(?=a)*/' |
19 | ||
ac561586 | 20 | /%.127s/: Unrecognized escape \\%c passed through [S_regatom] |
e476b1b5 | 21 | $x = '\m' ; /$x/ |
599cee73 | 22 | |
cd84f5b2 | 23 | POSIX syntax [%c %c] belongs inside character classes [S_checkposixcc] |
f9373011 PM |
24 | |
25 | ||
ac561586 JH |
26 | Character class [:%.*s:] unknown [S_regpposixcc] |
27 | ||
767a6a26 PM |
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 JH |
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 PM |
38 | False [] range \"%*.*s\" [S_regclass] |
39 | ||
599cee73 | 40 | __END__ |
767a6a26 | 41 | # regcomp.c [S_regpiece] |
e476b1b5 | 42 | use warnings 'regexp' ; |
599cee73 PM |
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 GS |
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 PM |
58 | ######## |
59 | # regcomp.c [S_regpposixcc S_checkposixcc] | |
7f01dc7a | 60 | # |
e476b1b5 | 61 | use warnings 'regexp' ; |
599cee73 | 62 | $_ = "" ; |
e8c223df | 63 | /[:alpha:]/; |
e8c223df | 64 | /[:zog:]/; |
e476b1b5 | 65 | no warnings 'regexp' ; |
e8c223df | 66 | /[:alpha:]/; |
ac561586 | 67 | /[:zog:]/; |
599cee73 | 68 | EXPECT |
7253e4e3 RK |
69 | POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:alpha:] <-- HERE / at - line 5. |
70 | POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:zog:] <-- HERE / at - line 6. | |
3802429d JF |
71 | ######## |
72 | # regcomp.c [S_checkposixcc] | |
7f01dc7a | 73 | # |
3802429d JF |
74 | use warnings 'regexp' ; |
75 | $_ = "" ; | |
76 | /[.zog.]/; | |
77 | no warnings 'regexp' ; | |
78 | /[.zog.]/; | |
79 | EXPECT | |
7253e4e3 RK |
80 | POSIX syntax [. .] belongs inside character classes in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5. |
81 | POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[.zog.] <-- HERE / | |
3802429d | 82 | ######## |
73b437c8 JH |
83 | # regcomp.c [S_regclass] |
84 | $_ = ""; | |
e476b1b5 | 85 | use warnings 'regexp' ; |
73b437c8 JH |
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:]]/; | |
e476b1b5 | 95 | no warnings 'regexp' ; |
73b437c8 JH |
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:]]/; | |
105 | EXPECT | |
7253e4e3 RK |
106 | False [] range "a-\d" in regex; marked by <-- HERE in m/[a-\d <-- HERE ]/ at - line 5. |
107 | False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE b]/ at - line 6. | |
108 | False [] range "\s-" in regex; marked by <-- HERE in m/[\s- <-- HERE \d]/ at - line 7. | |
109 | False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE \s]/ at - line 8. | |
110 | False [] range "a-[:digit:]" in regex; marked by <-- HERE in m/[a-[:digit:] <-- HERE ]/ at - line 9. | |
111 | False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE b]/ at - line 10. | |
112 | False [] range "[:alpha:]-" in regex; marked by <-- HERE in m/[[:alpha:]- <-- HERE [:digit:]]/ at - line 11. | |
113 | False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE [:alpha:]]/ at - line 12. | |
73b437c8 JH |
114 | ######## |
115 | # regcomp.c [S_regclassutf8] | |
59af8754 GS |
116 | BEGIN { |
117 | if (ord("\t") == 5) { | |
118 | print "SKIPPED\n# ebcdic regular expression ranges differ."; | |
119 | exit 0; | |
120 | } | |
121 | } | |
73b437c8 JH |
122 | use utf8; |
123 | $_ = ""; | |
e476b1b5 | 124 | use warnings 'regexp' ; |
73b437c8 JH |
125 | /[a-b]/; |
126 | /[a-\d]/; | |
127 | /[\d-b]/; | |
128 | /[\s-\d]/; | |
129 | /[\d-\s]/; | |
130 | /[a-[:digit:]]/; | |
131 | /[[:digit:]-b]/; | |
132 | /[[:alpha:]-[:digit:]]/; | |
133 | /[[:digit:]-[:alpha:]]/; | |
e476b1b5 | 134 | no warnings 'regexp' ; |
73b437c8 JH |
135 | /[a-b]/; |
136 | /[a-\d]/; | |
137 | /[\d-b]/; | |
138 | /[\s-\d]/; | |
139 | /[\d-\s]/; | |
140 | /[a-[:digit:]]/; | |
141 | /[[:digit:]-b]/; | |
142 | /[[:alpha:]-[:digit:]]/; | |
143 | /[[:digit:]-[:alpha:]]/; | |
144 | EXPECT | |
7253e4e3 RK |
145 | False [] range "a-\d" in regex; marked by <-- HERE in m/[a-\d <-- HERE ]/ at - line 12. |
146 | False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE b]/ at - line 13. | |
147 | False [] range "\s-" in regex; marked by <-- HERE in m/[\s- <-- HERE \d]/ at - line 14. | |
148 | False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE \s]/ at - line 15. | |
149 | False [] range "a-[:digit:]" in regex; marked by <-- HERE in m/[a-[:digit:] <-- HERE ]/ at - line 16. | |
150 | False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE b]/ at - line 17. | |
151 | False [] range "[:alpha:]-" in regex; marked by <-- HERE in m/[[:alpha:]- <-- HERE [:digit:]]/ at - line 18. | |
152 | False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE [:alpha:]]/ at - line 19. | |
1028017a JH |
153 | ######## |
154 | # regcomp.c [S_regclass S_regclassutf8] | |
e476b1b5 | 155 | use warnings 'regexp' ; |
1028017a | 156 | $a =~ /[a\zb]/ ; |
e476b1b5 | 157 | no warnings 'regexp' ; |
1028017a JH |
158 | $a =~ /[a\zb]/ ; |
159 | EXPECT | |
7253e4e3 | 160 | Unrecognized escape \z in character class passed through in regex; marked by <-- HERE in m/[a\z <-- HERE b]/ at - line 3. |
b45f050a | 161 | |
f9373011 PM |
162 | ######## |
163 | # regcomp.c [S_study_chunk] | |
164 | use warnings 'deprecated' ; | |
165 | $a = "xx" ; | |
166 | $a =~ /(?p{'x'})/ ; | |
167 | no warnings ; | |
168 | use warnings 'regexp' ; | |
169 | $a =~ /(?p{'x'})/ ; | |
170 | use warnings; | |
171 | no warnings 'deprecated' ; | |
172 | no warnings 'regexp' ; | |
12bcd1a6 | 173 | no warnings 'syntax' ; |
f9373011 PM |
174 | $a =~ /(?p{'x'})/ ; |
175 | EXPECT | |
176 | (?p{}) is deprecated - use (??{}) in regex; marked by <-- HERE in m/(?p <-- HERE {'x'})/ at - line 4. | |
177 | (?p{}) is deprecated - use (??{}) in regex; marked by <-- HERE in m/(?p <-- HERE {'x'})/ at - line 7. | |
178 | ######## | |
179 | # regcomp.c [S_reg] | |
180 | use warnings 'regexp' ; | |
181 | $a = qr/(?c)/; | |
182 | $a = qr/(?-c)/; | |
183 | $a = qr/(?g)/; | |
184 | $a = qr/(?-g)/; | |
185 | $a = qr/(?o)/; | |
186 | $a = qr/(?-o)/; | |
187 | $a = qr/(?g-o)/; | |
188 | $a = qr/(?g-c)/; | |
189 | $a = qr/(?o-cg)/; # (?c) means (?g) error won't be thrown | |
190 | $a = qr/(?ogc)/; | |
191 | no warnings 'regexp' ; | |
192 | $a = qr/(?c)/; | |
193 | $a = qr/(?-c)/; | |
194 | $a = qr/(?g)/; | |
195 | $a = qr/(?-g)/; | |
196 | $a = qr/(?o)/; | |
197 | $a = qr/(?-o)/; | |
198 | $a = qr/(?g-o)/; | |
199 | $a = qr/(?g-c)/; | |
200 | $a = qr/(?o-cg)/; # (?c) means (?g) error won't be thrown | |
201 | $a = qr/(?ogc)/; | |
202 | #EXPECT | |
203 | EXPECT | |
204 | Useless (?c) - use /gc modifier in regex; marked by <-- HERE in m/(?c <-- HERE )/ at - line 3. | |
205 | Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?-c <-- HERE )/ at - line 4. | |
206 | Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE )/ at - line 5. | |
207 | Useless (?-g) - don't use /g modifier in regex; marked by <-- HERE in m/(?-g <-- HERE )/ at - line 6. | |
208 | Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE )/ at - line 7. | |
209 | Useless (?-o) - don't use /o modifier in regex; marked by <-- HERE in m/(?-o <-- HERE )/ at - line 8. | |
210 | Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE -o)/ at - line 9. | |
211 | Useless (?-o) - don't use /o modifier in regex; marked by <-- HERE in m/(?g-o <-- HERE )/ at - line 9. | |
212 | Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE -c)/ at - line 10. | |
213 | Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?g-c <-- HERE )/ at - line 10. | |
214 | Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE -cg)/ at - line 11. | |
215 | Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?o-c <-- HERE g)/ at - line 11. | |
216 | Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE gc)/ at - line 12. | |
217 | Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?og <-- HERE c)/ at - line 12. | |
218 | Useless (?c) - use /gc modifier in regex; marked by <-- HERE in m/(?ogc <-- HERE )/ at - line 12. |