Remove the "Newline in left-justified string" warning.
[p5sagit/p5-mst-13.2.git] / t / lib / warnings / regcomp
1   regcomp.c     AOK
2
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
14   Strange *+?{} on zero-length expression       [S_study_chunk]
15         /(?=a)?/
16
17   %.*s matches null string many times           [S_regpiece]
18         $a = "ABC123" ; $a =~ /(?=a)*/'
19
20   /%.127s/: Unrecognized escape \\%c passed through     [S_regatom] 
21         $x = '\m' ; /$x/
22
23   POSIX syntax [%c %c] belongs inside character classes [S_checkposixcc] 
24
25
26   Character class [:%.*s:] unknown      [S_regpposixcc]
27
28   Character class syntax [%c %c] belongs inside character classes [S_checkposixcc] 
29   
30   /%.127s/: false [] range \"%*.*s\" in regexp [S_regclass]
31
32   /%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8]
33
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
38   False [] range \"%*.*s\" [S_regclass]
39
40 __END__
41 # regcomp.c [S_regpiece]
42 use warnings 'regexp' ;
43 my $a = "ABC123" ; 
44 $a =~ /(?=a)*/ ;
45 no warnings 'regexp' ;
46 $a =~ /(?=a)*/ ;
47 EXPECT
48 (?=a)* matches null string many times in regex; marked by <-- HERE in m/(?=a)* <-- HERE / at - line 4.
49 ########
50 # regcomp.c [S_regatom]
51 $x = '\m' ;
52 use warnings 'regexp' ;
53 $a =~ /a$x/ ;
54 no warnings 'regexp' ;
55 $a =~ /a$x/ ;
56 EXPECT
57 Unrecognized escape \m passed through in regex; marked by <-- HERE in m/a\m <-- HERE / at - line 4.
58 ########
59 # regcomp.c [S_regpposixcc S_checkposixcc]
60 #
61 use warnings 'regexp' ;
62 $_ = "" ;
63 /[:alpha:]/;
64 /[:zog:]/;
65 no warnings 'regexp' ;
66 /[:alpha:]/;
67 /[:zog:]/;
68 EXPECT
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.
71 ########
72 # regcomp.c [S_checkposixcc]
73 #
74 use warnings 'regexp' ;
75 $_ = "" ;
76 /[.zog.]/;
77 no warnings 'regexp' ;
78 /[.zog.]/;
79 EXPECT
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 / at - line 5.
82 ########
83 # regcomp.c [S_regclass]
84 $_ = "";
85 use warnings 'regexp' ;
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:]]/;
95 no warnings 'regexp' ;
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
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.
114 ########
115 # regcomp.c [S_regclassutf8]
116 BEGIN {
117     if (ord("\t") == 5) {
118         print "SKIPPED\n# ebcdic regular expression ranges differ.";
119         exit 0;
120     }
121 }
122 use utf8;
123 $_ = "";
124 use warnings 'regexp' ;
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:]]/;
134 no warnings 'regexp' ;
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
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.
153 ########
154 # regcomp.c [S_regclass S_regclassutf8]
155 use warnings 'regexp' ;
156 $a =~ /[a\zb]/ ;
157 no warnings 'regexp' ;
158 $a =~ /[a\zb]/ ;
159 EXPECT
160 Unrecognized escape \z in character class passed through in regex; marked by <-- HERE in m/[a\z <-- HERE b]/ at - line 3.
161
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' ;
173 no warnings 'syntax' ;
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.