chiark / gitweb /
pcre3 (2:8.35-3.3) unstable; urgency=medium
[pcre3.git] / testdata / testinput9
1 /-- This set of tests checks UTF-8 support with the DFA matching functionality
2     of pcre_dfa_exec(), excluding Unicode property support. The -dfa flag must
3     be used with pcretest when running it. --/
4     
5 < forbid W 
6
7 /\x{100}ab/8
8   \x{100}ab
9   
10 /a\x{100}*b/8
11     ab
12     a\x{100}b  
13     a\x{100}\x{100}b  
14     
15 /a\x{100}+b/8
16     a\x{100}b  
17     a\x{100}\x{100}b  
18     *** Failers 
19     ab
20      
21 /\bX/8
22     Xoanon
23     +Xoanon
24     \x{300}Xoanon 
25     *** Failers 
26     YXoanon  
27     
28 /\BX/8
29     YXoanon
30     *** Failers
31     Xoanon
32     +Xoanon    
33     \x{300}Xoanon 
34
35 /X\b/8
36     X+oanon
37     ZX\x{300}oanon 
38     FAX 
39     *** Failers 
40     Xoanon  
41     
42 /X\B/8
43     Xoanon  
44     *** Failers
45     X+oanon
46     ZX\x{300}oanon 
47     FAX 
48     
49 /[^a]/8
50     abcd
51     a\x{100}   
52
53 /^[abc\x{123}\x{400}-\x{402}]{2,3}\d/8
54     ab99
55     \x{123}\x{123}45
56     \x{400}\x{401}\x{402}6  
57     *** Failers
58     d99
59     \x{123}\x{122}4   
60     \x{400}\x{403}6  
61     \x{400}\x{401}\x{402}\x{402}6  
62
63 /a.b/8
64     acb
65     a\x7fb
66     a\x{100}b 
67     *** Failers
68     a\nb  
69
70 /a(.{3})b/8
71     a\x{4000}xyb 
72     a\x{4000}\x7fyb 
73     a\x{4000}\x{100}yb 
74     *** Failers
75     a\x{4000}b 
76     ac\ncb 
77
78 /a(.*?)(.)/
79     a\xc0\x88b
80
81 /a(.*?)(.)/8
82     a\x{100}b
83
84 /a(.*)(.)/
85     a\xc0\x88b
86
87 /a(.*)(.)/8
88     a\x{100}b
89
90 /a(.)(.)/
91     a\xc0\x92bcd
92
93 /a(.)(.)/8
94     a\x{240}bcd
95
96 /a(.?)(.)/
97     a\xc0\x92bcd
98
99 /a(.?)(.)/8
100     a\x{240}bcd
101
102 /a(.??)(.)/
103     a\xc0\x92bcd
104
105 /a(.??)(.)/8
106     a\x{240}bcd
107
108 /a(.{3})b/8
109     a\x{1234}xyb 
110     a\x{1234}\x{4321}yb 
111     a\x{1234}\x{4321}\x{3412}b 
112     *** Failers
113     a\x{1234}b 
114     ac\ncb 
115
116 /a(.{3,})b/8
117     a\x{1234}xyb 
118     a\x{1234}\x{4321}yb 
119     a\x{1234}\x{4321}\x{3412}b 
120     axxxxbcdefghijb 
121     a\x{1234}\x{4321}\x{3412}\x{3421}b 
122     *** Failers
123     a\x{1234}b 
124
125 /a(.{3,}?)b/8
126     a\x{1234}xyb 
127     a\x{1234}\x{4321}yb 
128     a\x{1234}\x{4321}\x{3412}b 
129     axxxxbcdefghijb 
130     a\x{1234}\x{4321}\x{3412}\x{3421}b 
131     *** Failers
132     a\x{1234}b 
133
134 /a(.{3,5})b/8
135     a\x{1234}xyb 
136     a\x{1234}\x{4321}yb 
137     a\x{1234}\x{4321}\x{3412}b 
138     axxxxbcdefghijb 
139     a\x{1234}\x{4321}\x{3412}\x{3421}b 
140     axbxxbcdefghijb 
141     axxxxxbcdefghijb 
142     *** Failers
143     a\x{1234}b 
144     axxxxxxbcdefghijb 
145
146 /a(.{3,5}?)b/8
147     a\x{1234}xyb 
148     a\x{1234}\x{4321}yb 
149     a\x{1234}\x{4321}\x{3412}b 
150     axxxxbcdefghijb 
151     a\x{1234}\x{4321}\x{3412}\x{3421}b 
152     axbxxbcdefghijb 
153     axxxxxbcdefghijb 
154     *** Failers
155     a\x{1234}b 
156     axxxxxxbcdefghijb 
157
158 /^[a\x{c0}]/8
159     *** Failers
160     \x{100}
161
162 /(?<=aXb)cd/8
163     aXbcd
164
165 /(?<=a\x{100}b)cd/8
166     a\x{100}bcd
167
168 /(?<=a\x{100000}b)cd/8
169     a\x{100000}bcd
170     
171 /(?:\x{100}){3}b/8
172     \x{100}\x{100}\x{100}b
173     *** Failers 
174     \x{100}\x{100}b
175
176 /\x{ab}/8
177     \x{ab} 
178     \xc2\xab
179     *** Failers 
180     \x00{ab}
181
182 /(?<=(.))X/8
183     WXYZ
184     \x{256}XYZ 
185     *** Failers
186     XYZ 
187
188 /[^a]+/8g
189     bcd
190     \x{100}aY\x{256}Z 
191     
192 /^[^a]{2}/8
193     \x{100}bc
194  
195 /^[^a]{2,}/8
196     \x{100}bcAa
197
198 /^[^a]{2,}?/8
199     \x{100}bca
200
201 /[^a]+/8ig
202     bcd
203     \x{100}aY\x{256}Z 
204     
205 /^[^a]{2}/8i
206     \x{100}bc
207  
208 /^[^a]{2,}/8i
209     \x{100}bcAa
210
211 /^[^a]{2,}?/8i
212     \x{100}bca
213
214 /\x{100}{0,0}/8
215     abcd
216  
217 /\x{100}?/8
218     abcd
219     \x{100}\x{100} 
220
221 /\x{100}{0,3}/8 
222     \x{100}\x{100} 
223     \x{100}\x{100}\x{100}\x{100} 
224     
225 /\x{100}*/8
226     abce
227     \x{100}\x{100}\x{100}\x{100} 
228
229 /\x{100}{1,1}/8
230     abcd\x{100}\x{100}\x{100}\x{100} 
231
232 /\x{100}{1,3}/8
233     abcd\x{100}\x{100}\x{100}\x{100} 
234
235 /\x{100}+/8
236     abcd\x{100}\x{100}\x{100}\x{100} 
237
238 /\x{100}{3}/8
239     abcd\x{100}\x{100}\x{100}XX
240
241 /\x{100}{3,5}/8
242     abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX
243
244 /\x{100}{3,}/8O
245     abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX
246
247 /(?<=a\x{100}{2}b)X/8
248     Xyyya\x{100}\x{100}bXzzz
249
250 /\D*/8O
251   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
252
253 /\D*/8O
254   \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}
255
256 /\D/8
257     1X2
258     1\x{100}2 
259   
260 />\S/8
261     > >X Y
262     > >\x{100} Y
263   
264 /\d/8
265     \x{100}3
266     
267 /\s/8
268     \x{100} X
269     
270 /\D+/8
271     12abcd34
272     *** Failers
273     1234  
274
275 /\D{2,3}/8
276     12abcd34
277     12ab34
278     *** Failers  
279     1234
280     12a34  
281
282 /\D{2,3}?/8
283     12abcd34
284     12ab34
285     *** Failers  
286     1234
287     12a34  
288
289 /\d+/8
290     12abcd34
291     *** Failers
292
293 /\d{2,3}/8
294     12abcd34
295     1234abcd
296     *** Failers  
297     1.4 
298
299 /\d{2,3}?/8
300     12abcd34
301     1234abcd
302     *** Failers  
303     1.4 
304
305 /\S+/8
306     12abcd34
307     *** Failers
308     \    \ 
309
310 /\S{2,3}/8
311     12abcd34
312     1234abcd
313     *** Failers
314     \     \  
315
316 /\S{2,3}?/8
317     12abcd34
318     1234abcd
319     *** Failers
320     \     \  
321
322 />\s+</8
323     12>      <34
324     *** Failers
325
326 />\s{2,3}</8
327     ab>  <cd
328     ab>   <ce
329     *** Failers
330     ab>    <cd 
331
332 />\s{2,3}?</8
333     ab>  <cd
334     ab>   <ce
335     *** Failers
336     ab>    <cd 
337
338 /\w+/8
339     12      34
340     *** Failers
341     +++=*! 
342
343 /\w{2,3}/8
344     ab  cd
345     abcd ce
346     *** Failers
347     a.b.c
348
349 /\w{2,3}?/8
350     ab  cd
351     abcd ce
352     *** Failers
353     a.b.c
354
355 /\W+/8
356     12====34
357     *** Failers
358     abcd 
359
360 /\W{2,3}/8
361     ab====cd
362     ab==cd
363     *** Failers
364     a.b.c
365
366 /\W{2,3}?/8
367     ab====cd
368     ab==cd
369     *** Failers
370     a.b.c
371
372 /[\x{100}]/8
373     \x{100}
374     Z\x{100}
375     \x{100}Z
376     *** Failers 
377
378 /[Z\x{100}]/8
379     Z\x{100}
380     \x{100}
381     \x{100}Z
382     *** Failers 
383
384 /[\x{100}\x{200}]/8
385    ab\x{100}cd
386    ab\x{200}cd
387    *** Failers  
388
389 /[\x{100}-\x{200}]/8
390    ab\x{100}cd
391    ab\x{200}cd
392    ab\x{111}cd 
393    *** Failers  
394
395 /[z-\x{200}]/8
396    ab\x{100}cd
397    ab\x{200}cd
398    ab\x{111}cd 
399    abzcd
400    ab|cd  
401    *** Failers  
402
403 /[Q\x{100}\x{200}]/8
404    ab\x{100}cd
405    ab\x{200}cd
406    Q? 
407    *** Failers  
408
409 /[Q\x{100}-\x{200}]/8
410    ab\x{100}cd
411    ab\x{200}cd
412    ab\x{111}cd 
413    Q? 
414    *** Failers  
415
416 /[Qz-\x{200}]/8
417    ab\x{100}cd
418    ab\x{200}cd
419    ab\x{111}cd 
420    abzcd
421    ab|cd  
422    Q? 
423    *** Failers  
424
425 /[\x{100}\x{200}]{1,3}/8
426    ab\x{100}cd
427    ab\x{200}cd
428    ab\x{200}\x{100}\x{200}\x{100}cd
429    *** Failers  
430
431 /[\x{100}\x{200}]{1,3}?/8
432    ab\x{100}cd
433    ab\x{200}cd
434    ab\x{200}\x{100}\x{200}\x{100}cd
435    *** Failers  
436
437 /[Q\x{100}\x{200}]{1,3}/8
438    ab\x{100}cd
439    ab\x{200}cd
440    ab\x{200}\x{100}\x{200}\x{100}cd
441    *** Failers  
442
443 /[Q\x{100}\x{200}]{1,3}?/8
444    ab\x{100}cd
445    ab\x{200}cd
446    ab\x{200}\x{100}\x{200}\x{100}cd
447    *** Failers  
448
449 /(?<=[\x{100}\x{200}])X/8
450     abc\x{200}X
451     abc\x{100}X 
452     *** Failers
453     X  
454
455 /(?<=[Q\x{100}\x{200}])X/8
456     abc\x{200}X
457     abc\x{100}X 
458     abQX 
459     *** Failers
460     X  
461
462 /(?<=[\x{100}\x{200}]{3})X/8
463     abc\x{100}\x{200}\x{100}X
464     *** Failers
465     abc\x{200}X
466     X  
467
468 /[^\x{100}\x{200}]X/8
469     AX
470     \x{150}X
471     \x{500}X 
472     *** Failers
473     \x{100}X
474     \x{200}X   
475
476 /[^Q\x{100}\x{200}]X/8
477     AX
478     \x{150}X
479     \x{500}X 
480     *** Failers
481     \x{100}X
482     \x{200}X   
483     QX 
484
485 /[^\x{100}-\x{200}]X/8
486     AX
487     \x{500}X 
488     *** Failers
489     \x{100}X
490     \x{150}X
491     \x{200}X   
492
493 /[z-\x{100}]/8i
494     z
495     Z 
496     \x{100}
497     *** Failers
498     \x{102}
499     y    
500
501 /[\xFF]/
502     >\xff<
503
504 /[\xff]/8
505     >\x{ff}<
506
507 /[^\xFF]/
508     XYZ
509
510 /[^\xff]/8
511     XYZ
512     \x{123} 
513
514 /^[ac]*b/8
515   xb
516
517 /^[ac\x{100}]*b/8
518   xb
519
520 /^[^x]*b/8i
521   xb
522
523 /^[^x]*b/8
524   xb
525   
526 /^\d*b/8
527   xb 
528
529 /(|a)/g8
530     catac
531     a\x{256}a 
532
533 /^\x{85}$/8i
534     \x{85}
535
536 /^abc./mgx8<any>
537     abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x{0085}abc7 \x{2028}abc8 \x{2029}abc9 JUNK
538
539 /abc.$/mgx8<any>
540     abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x{0085} abc7\x{2028} abc8\x{2029} abc9
541
542 /^a\Rb/8<bsr_unicode>
543     a\nb
544     a\rb
545     a\r\nb
546     a\x0bb
547     a\x0cb
548     a\x{85}b   
549     a\x{2028}b 
550     a\x{2029}b 
551     ** Failers
552     a\n\rb    
553
554 /^a\R*b/8<bsr_unicode>
555     ab
556     a\nb
557     a\rb
558     a\r\nb
559     a\x0bb
560     a\x0c\x{2028}\x{2029}b
561     a\x{85}b   
562     a\n\rb    
563     a\n\r\x{85}\x0cb 
564
565 /^a\R+b/8<bsr_unicode>
566     a\nb
567     a\rb
568     a\r\nb
569     a\x0bb
570     a\x0c\x{2028}\x{2029}b
571     a\x{85}b   
572     a\n\rb    
573     a\n\r\x{85}\x0cb 
574     ** Failers
575     ab  
576
577 /^a\R{1,3}b/8<bsr_unicode>
578     a\nb
579     a\n\rb
580     a\n\r\x{85}b
581     a\r\n\r\nb 
582     a\r\n\r\n\r\nb 
583     a\n\r\n\rb
584     a\n\n\r\nb 
585     ** Failers
586     a\n\n\n\rb
587     a\r
588
589 /\h+\V?\v{3,4}/8O
590     \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
591
592 /\V?\v{3,4}/8O 
593     \x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
594
595 /\h+\V?\v{3,4}/8O
596     >\x09\x20\x{a0}X\x0a\x0a\x0a<
597
598 /\V?\v{3,4}/8O
599     >\x09\x20\x{a0}X\x0a\x0a\x0a<
600
601 /\H\h\V\v/8
602     X X\x0a
603     X\x09X\x0b
604     ** Failers
605     \x{a0} X\x0a   
606     
607 /\H*\h+\V?\v{3,4}/8O 
608     \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
609     \x09\x20\x{a0}\x0a\x0b\x0c\x0d\x0a
610     \x09\x20\x{a0}\x0a\x0b\x0c
611     ** Failers 
612     \x09\x20\x{a0}\x0a\x0b
613      
614 /\H\h\V\v/8
615     \x{3001}\x{3000}\x{2030}\x{2028}
616     X\x{180e}X\x{85}
617     ** Failers
618     \x{2009} X\x0a   
619     
620 /\H*\h+\V?\v{3,4}/8O 
621     \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a
622     \x09\x{205f}\x{a0}\x0a\x{2029}\x0c\x{2028}\x0a
623     \x09\x20\x{202f}\x0a\x0b\x0c
624     ** Failers 
625     \x09\x{200a}\x{a0}\x{2028}\x0b
626      
627 /a\Rb/I8<bsr_anycrlf>
628     a\rb
629     a\nb
630     a\r\nb
631     ** Failers
632     a\x{85}b
633     a\x0bb     
634
635 /a\Rb/I8<bsr_unicode>
636     a\rb
637     a\nb
638     a\r\nb
639     a\x{85}b
640     a\x0bb     
641     ** Failers 
642     a\x{85}b\<bsr_anycrlf>
643     a\x0bb\<bsr_anycrlf>
644     
645 /a\R?b/I8<bsr_anycrlf>
646     a\rb
647     a\nb
648     a\r\nb
649     ** Failers
650     a\x{85}b
651     a\x0bb     
652
653 /a\R?b/I8<bsr_unicode>
654     a\rb
655     a\nb
656     a\r\nb
657     a\x{85}b
658     a\x0bb     
659     ** Failers 
660     a\x{85}b\<bsr_anycrlf>
661     a\x0bb\<bsr_anycrlf>
662  
663 /X/8f<any> 
664     A\x{1ec5}ABCXYZ
665
666 /abcd*/8
667     xxxxabcd\P
668     xxxxabcd\P\P
669
670 /abcd*/i8
671     xxxxabcd\P
672     xxxxabcd\P\P
673     XXXXABCD\P
674     XXXXABCD\P\P
675
676 /abc\d*/8
677     xxxxabc1\P
678     xxxxabc1\P\P
679
680 /abc[de]*/8
681     xxxxabcde\P
682     xxxxabcde\P\P
683
684 /\bthe cat\b/8
685     the cat\P
686     the cat\P\P
687
688 /ab\Cde/8
689     abXde
690
691 /(?<=ab\Cde)X/8
692
693 /./8<CRLF>
694     \r\P
695     \r\P\P 
696   
697 /.{2,3}/8<CRLF>
698     \r\P 
699     \r\P\P
700     \r\r\P
701     \r\r\P\P
702     \r\r\r\P
703     \r\r\r\P\P     
704
705 /.{2,3}?/8<CRLF>
706     \r\P 
707     \r\P\P
708     \r\r\P
709     \r\r\P\P
710     \r\r\r\P
711     \r\r\r\P\P     
712
713 /[^\x{100}]/8
714     \x{100}\x{101}X
715
716 /[^\x{100}]+/8
717     \x{100}\x{101}X
718
719 /-- End of testinput9 --/