| author | Ruben Gonzalez <drifter01620@gmail.com> |
| Thu May 22 09:49:27 2014 -0400 (2014-05-22) | |
| changeset 4378 | 568f4497ef4a |
| parent 3831 | babd0eee3c5e |
| permissions | -rw-r--r-- |
1 /-- These tests for Unicode property support test PCRE's API and show some of
2 the compiled code. They are not Perl-compatible. --/
4 /[\p{L}]/DZ
6 /[\p{^L}]/DZ
8 /[\P{L}]/DZ
10 /[\P{^L}]/DZ
12 /[abc\p{L}\x{0660}]/8DZ
14 /[\p{Nd}]/8DZ
15 1234
17 /[\p{Nd}+-]+/8DZ
18 1234
19 12-34
20 12+\x{661}-34
21 ** Failers
22 abcd
24 /[\x{105}-\x{109}]/8iDZ
25 \x{104}
26 \x{105}
27 \x{109}
28 ** Failers
29 \x{100}
30 \x{10a}
32 /[z-\x{100}]/8iDZ
33 Z
34 z
35 \x{39c}
36 \x{178}
37 |
38 \x{80}
39 \x{ff}
40 \x{100}
41 \x{101}
42 ** Failers
43 \x{102}
44 Y
45 y
47 /[z-\x{100}]/8DZi
49 /(?:[\PPa*]*){8,}/
51 /[\P{Any}]/BZ
53 /[\P{Any}\E]/BZ
55 /(\P{Yi}+\277)/
57 /(\P{Yi}+\277)?/
59 /(?<=\P{Yi}{3}A)X/
61 /\p{Yi}+(\P{Yi}+)(?1)/
63 /(\P{Yi}{2}\277)?/
65 /[\P{Yi}A]/
67 /[\P{Yi}\P{Yi}\P{Yi}A]/
69 /[^\P{Yi}A]/
71 /[^\P{Yi}\P{Yi}\P{Yi}A]/
73 /(\P{Yi}*\277)*/
75 /(\P{Yi}*?\277)*/
77 /(\p{Yi}*+\277)*/
79 /(\P{Yi}?\277)*/
81 /(\P{Yi}??\277)*/
83 /(\p{Yi}?+\277)*/
85 /(\P{Yi}{0,3}\277)*/
87 /(\P{Yi}{0,3}?\277)*/
89 /(\p{Yi}{0,3}+\277)*/
91 /\p{Zl}{2,3}+/8BZ
95 \x{2028}\x{2028}\x{2028}
97 /\p{Zl}/8BZ
99 /\p{Lu}{3}+/8BZ
101 /\pL{2}+/8BZ
103 /\p{Cc}{2}+/8BZ
105 /^\p{Cs}/8
106 \?\x{dfff}
107 ** Failers
108 \x{09f}
110 /^\p{Sc}+/8
111 $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6}
112 \x{9f2}
113 ** Failers
114 X
115 \x{2c2}
117 /^\p{Zs}/8
118 \ \
119 \x{a0}
120 \x{1680}
121 \x{180e}
122 \x{2000}
123 \x{2001}
124 ** Failers
125 \x{2028}
126 \x{200d}
128 /-- These four are here rather than in test 6 because Perl has problems with
129 the negative versions of the properties. --/
131 /\p{^Lu}/8i
132 1234
133 ** Failers
134 ABC
136 /\P{Lu}/8i
137 1234
138 ** Failers
139 ABC
141 /\p{Ll}/8i
142 a
143 Az
144 ** Failers
145 ABC
147 /\p{Lu}/8i
148 A
149 a\x{10a0}B
150 ** Failers
151 a
152 \x{1d00}
154 /[\x{c0}\x{391}]/8i
155 \x{c0}
156 \x{e0}
158 /-- The next two are special cases where the lengths of the different cases of
159 the same character differ. The first went wrong with heap frame storage; the
160 second was broken in all cases. --/
162 /^\x{023a}+?(\x{0130}+)/8i
163 \x{023a}\x{2c65}\x{0130}
165 /^\x{023a}+([^X])/8i
166 \x{023a}\x{2c65}X
168 /\x{c0}+\x{116}+/8i
169 \x{c0}\x{e0}\x{116}\x{117}
171 /[\x{c0}\x{116}]+/8i
172 \x{c0}\x{e0}\x{116}\x{117}
174 /(\x{de})\1/8i
175 \x{de}\x{de}
176 \x{de}\x{fe}
177 \x{fe}\x{fe}
178 \x{fe}\x{de}
180 /^\x{c0}$/8i
181 \x{c0}
182 \x{e0}
184 /^\x{e0}$/8i
185 \x{c0}
186 \x{e0}
188 /-- The next two should be Perl-compatible, but it fails to match \x{e0}. PCRE
189 will match it only with UCP support, because without that it has no notion
190 of case for anything other than the ASCII letters. --/
192 /((?i)[\x{c0}])/8
193 \x{c0}
194 \x{e0}
196 /(?i:[\x{c0}])/8
197 \x{c0}
198 \x{e0}
200 /-- These are PCRE's extra properties to help with Unicodizing \d etc. --/
202 /^\p{Xan}/8
203 ABCD
204 1234
205 \x{6ca}
206 \x{a6c}
207 \x{10a7}
208 ** Failers
209 _ABC
211 /^\p{Xan}+/8
212 ABCD1234\x{6ca}\x{a6c}\x{10a7}_
213 ** Failers
214 _ABC
216 /^\p{Xan}+?/8
217 \x{6ca}\x{a6c}\x{10a7}_
219 /^\p{Xan}*/8
220 ABCD1234\x{6ca}\x{a6c}\x{10a7}_
222 /^\p{Xan}{2,9}/8
223 ABCD1234\x{6ca}\x{a6c}\x{10a7}_
225 /^\p{Xan}{2,9}?/8
226 \x{6ca}\x{a6c}\x{10a7}_
228 /^[\p{Xan}]/8
229 ABCD1234_
230 1234abcd_
231 \x{6ca}
232 \x{a6c}
233 \x{10a7}
234 ** Failers
235 _ABC
237 /^[\p{Xan}]+/8
238 ABCD1234\x{6ca}\x{a6c}\x{10a7}_
239 ** Failers
240 _ABC
242 /^>\p{Xsp}/8
243 >\x{1680}\x{2028}\x{0b}
244 >\x{a0}
245 ** Failers
246 \x{0b}
248 /^>\p{Xsp}+/8
249 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
251 /^>\p{Xsp}+?/8
252 >\x{1680}\x{2028}\x{0b}
254 /^>\p{Xsp}*/8
255 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
257 /^>\p{Xsp}{2,9}/8
258 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
260 /^>\p{Xsp}{2,9}?/8
261 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
263 /^>[\p{Xsp}]/8
264 >\x{2028}\x{0b}
266 /^>[\p{Xsp}]+/8
267 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
269 /^>\p{Xps}/8
270 >\x{1680}\x{2028}\x{0b}
271 >\x{a0}
272 ** Failers
273 \x{0b}
275 /^>\p{Xps}+/8
276 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
278 /^>\p{Xps}+?/8
279 >\x{1680}\x{2028}\x{0b}
281 /^>\p{Xps}*/8
282 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
284 /^>\p{Xps}{2,9}/8
285 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
287 /^>\p{Xps}{2,9}?/8
288 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
290 /^>[\p{Xps}]/8
291 >\x{2028}\x{0b}
293 /^>[\p{Xps}]+/8
294 > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
296 /^\p{Xwd}/8
297 ABCD
298 1234
299 \x{6ca}
300 \x{a6c}
301 \x{10a7}
302 _ABC
303 ** Failers
304 []
306 /^\p{Xwd}+/8
307 ABCD1234\x{6ca}\x{a6c}\x{10a7}_
309 /^\p{Xwd}+?/8
310 \x{6ca}\x{a6c}\x{10a7}_
312 /^\p{Xwd}*/8
313 ABCD1234\x{6ca}\x{a6c}\x{10a7}_
315 /^\p{Xwd}{2,9}/8
316 A_B12\x{6ca}\x{a6c}\x{10a7}
318 /^\p{Xwd}{2,9}?/8
319 \x{6ca}\x{a6c}\x{10a7}_
321 /^[\p{Xwd}]/8
322 ABCD1234_
323 1234abcd_
324 \x{6ca}
325 \x{a6c}
326 \x{10a7}
327 _ABC
328 ** Failers
329 []
331 /^[\p{Xwd}]+/8
332 ABCD1234\x{6ca}\x{a6c}\x{10a7}_
334 /-- A check not in UTF-8 mode --/
336 /^[\p{Xwd}]+/
337 ABCD1234_
339 /-- Some negative checks --/
341 /^[\P{Xwd}]+/8
342 !.+\x{019}\x{35a}AB
344 /^[\p{^Xwd}]+/8
345 !.+\x{019}\x{35a}AB
347 /[\D]/WBZ8
348 1\x{3c8}2
350 /[\d]/WBZ8
351 >\x{6f4}<
353 /[\S]/WBZ8
354 \x{1680}\x{6f4}\x{1680}
356 /[\s]/WBZ8
357 >\x{1680}<
359 /[\W]/WBZ8
360 A\x{1712}B
362 /[\w]/WBZ8
363 >\x{1723}<
365 /\D/WBZ8
366 1\x{3c8}2
368 /\d/WBZ8
369 >\x{6f4}<
371 /\S/WBZ8
372 \x{1680}\x{6f4}\x{1680}
374 /\s/WBZ8
375 >\x{1680}>
377 /\W/WBZ8
378 A\x{1712}B
380 /\w/WBZ8
381 >\x{1723}<
383 /[[:alpha:]]/WBZ
385 /[[:lower:]]/WBZ
387 /[[:upper:]]/WBZ
389 /[[:alnum:]]/WBZ
391 /[[:ascii:]]/WBZ
393 /[[:cntrl:]]/WBZ
395 /[[:digit:]]/WBZ
397 /[[:graph:]]/WBZ
399 /[[:print:]]/WBZ
401 /[[:punct:]]/WBZ
403 /[[:space:]]/WBZ
405 /[[:word:]]/WBZ
407 /[[:xdigit:]]/WBZ
409 /-- Unicode properties for \b abd \B --/
411 /\b...\B/8W
412 abc_
413 \x{37e}abc\x{376}
414 \x{37e}\x{376}\x{371}\x{393}\x{394}
415 !\x{c0}++\x{c1}\x{c2}
416 !\x{c0}+++++
418 /-- Without PCRE_UCP, non-ASCII always fail, even if < 256 --/
420 /\b...\B/8
421 abc_
422 ** Failers
423 \x{37e}abc\x{376}
424 \x{37e}\x{376}\x{371}\x{393}\x{394}
425 !\x{c0}++\x{c1}\x{c2}
426 !\x{c0}+++++
428 /-- With PCRE_UCP, non-UTF8 chars that are < 256 still check properties --/
430 /\b...\B/W
431 abc_
432 !\x{c0}++\x{c1}\x{c2}
433 !\x{c0}+++++
435 /-- Some of these are silly, but they check various combinations --/
437 /[[:^alpha:][:^cntrl:]]+/8WBZ
438 123
439 abc
441 /[[:^cntrl:][:^alpha:]]+/8WBZ
442 123
443 abc
445 /[[:alpha:]]+/8WBZ
446 abc
448 /[[:^alpha:]\S]+/8WBZ
449 123
450 abc
452 /[^\d]+/8WBZ
453 abc123
454 abc\x{123}
455 \x{660}abc
457 /\p{Lu}+9\p{Lu}+B\p{Lu}+b/BZ
459 /\p{^Lu}+9\p{^Lu}+B\p{^Lu}+b/BZ
461 /\P{Lu}+9\P{Lu}+B\P{Lu}+b/BZ
463 /\p{Han}+X\p{Greek}+\x{370}/BZ8
465 /\p{Xan}+!\p{Xan}+A/BZ
467 /\p{Xsp}+!\p{Xsp}\t/BZ
469 /\p{Xps}+!\p{Xps}\t/BZ
471 /\p{Xwd}+!\p{Xwd}_/BZ
473 /A+\p{N}A+\dB+\p{N}*B+\d*/WBZ
475 /-- These behaved oddly in Perl, so they are kept in this test --/
477 /(\x{23a}\x{23a}\x{23a})?\1/8i
478 \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}
480 /(ȺȺȺ)?\1/8i
481 ȺȺȺⱥⱥ
483 /(\x{23a}\x{23a}\x{23a})?\1/8i
484 \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65}
486 /(ȺȺȺ)?\1/8i
487 ȺȺȺⱥⱥⱥ
489 /(\x{23a}\x{23a}\x{23a})\1/8i
490 \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}
492 /(ȺȺȺ)\1/8i
493 ȺȺȺⱥⱥ
495 /(\x{23a}\x{23a}\x{23a})\1/8i
496 \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65}
498 /(ȺȺȺ)\1/8i
499 ȺȺȺⱥⱥⱥ
501 /(\x{2c65}\x{2c65})\1/8i
502 \x{2c65}\x{2c65}\x{23a}\x{23a}
504 /(ⱥⱥ)\1/8i
505 ⱥⱥȺȺ
507 /(\x{23a}\x{23a}\x{23a})\1Y/8i
508 X\x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65}YZ
510 /(\x{2c65}\x{2c65})\1Y/8i
511 X\x{2c65}\x{2c65}\x{23a}\x{23a}YZ
513 /-- --/
515 /-- These scripts weren't yet in Perl when I added Unicode 6.0.0 to PCRE --/
517 /^[\p{Batak}]/8
518 \x{1bc0}
519 \x{1bff}
520 ** Failers
521 \x{1bf4}
523 /^[\p{Brahmi}]/8
524 \x{11000}
525 \x{1106f}
526 ** Failers
527 \x{1104e}
529 /^[\p{Mandaic}]/8
530 \x{840}
531 \x{85e}
532 ** Failers
533 \x{85c}
534 \x{85d}
536 /-- --/
538 /(\X*)(.)/s8
539 A\x{300}
541 /^S(\X*)e(\X*)$/8
542 Stéréo
544 /^\X/8
545 ́réo
547 /^a\X41z/<JS>
548 aX41z
549 *** Failers
550 aAz
552 /(?<=ab\Cde)X/8
554 /\X/
555 a\P
556 a\P\P
558 /\Xa/
559 aa\P
560 aa\P\P
562 /\X{2}/
563 aa\P
564 aa\P\P
566 /\X+a/
567 a\P
568 aa\P
569 aa\P\P
571 /\X+?a/
572 a\P
573 ab\P
574 aa\P
575 aa\P\P
576 aba\P
578 /-- These Unicode 6.1.0 scripts are not known to Perl. --/
580 /\p{Chakma}\d/8W
581 \x{11100}\x{1113c}
583 /\p{Takri}\d/8W
584 \x{11680}\x{116c0}
586 /^\X/8
587 A\P
588 A\P\P
589 A\x{300}\x{301}\P
590 A\x{300}\x{301}\P\P
591 A\x{301}\P
592 A\x{301}\P\P
594 /^\X{2,3}/8
595 A\P
596 A\P\P
597 AA\P
598 AA\P\P
599 A\x{300}\x{301}\P
600 A\x{300}\x{301}\P\P
601 A\x{300}\x{301}A\x{300}\x{301}\P
602 A\x{300}\x{301}A\x{300}\x{301}\P\P
604 /^\X{2}/8
605 AA\P
606 AA\P\P
607 A\x{300}\x{301}A\x{300}\x{301}\P
608 A\x{300}\x{301}A\x{300}\x{301}\P\P
610 /^\X+/8
611 AA\P
612 AA\P\P
614 /^\X+?Z/8
615 AA\P
616 AA\P\P
618 /A\x{3a3}B/8iDZ
620 /\x{3a3}B/8iDZ
622 /[\x{3a3}]/8iBZ
624 /[^\x{3a3}]/8iBZ
626 /[\x{3a3}]+/8iBZ
628 /[^\x{3a3}]+/8iBZ
630 /a*\x{3a3}/8iBZ
632 /\x{3a3}+a/8iBZ
634 /\x{3a3}*\x{3c2}/8iBZ
636 /\x{3a3}{3}/8i+
637 \x{3a3}\x{3c3}\x{3c2}\x{3a3}\x{3c3}\x{3c2}
639 /\x{3a3}{2,4}/8i+
640 \x{3a3}\x{3c3}\x{3c2}\x{3a3}\x{3c3}\x{3c2}
642 /\x{3a3}{2,4}?/8i+
643 \x{3a3}\x{3c3}\x{3c2}\x{3a3}\x{3c3}\x{3c2}
645 /\x{3a3}+./8i+
646 \x{3a3}\x{3c3}\x{3c2}\x{3a3}\x{3c3}\x{3c2}
648 /\x{3a3}++./8i+
649 ** Failers
650 \x{3a3}\x{3c3}\x{3c2}\x{3a3}\x{3c3}\x{3c2}
652 /\x{3a3}*\x{3c2}/8iBZ
654 /[^\x{3a3}]*\x{3c2}/8iBZ
656 /[^a]*\x{3c2}/8iBZ
658 /ist/8iBZ
659 ikt
661 /is+t/8i
662 iSs\x{17f}t
663 ikt
665 /is+?t/8i
666 ikt
668 /is?t/8i
669 ikt
671 /is{2}t/8i
672 iskt