--- embedaddon/pcre/testdata/testinput11 2012/02/21 23:05:52 1.1.1.1 +++ embedaddon/pcre/testdata/testinput11 2013/07/22 08:25:57 1.1.1.2 @@ -1,928 +1,135 @@ -/-- These tests are for the Perl >= 5.10 features that PCRE supports. --/ +/-- These are a few representative patterns whose lengths and offsets are to be +shown when the link size is 2. This is just a doublecheck test to ensure the +sizes don't go horribly wrong when something is changed. The pattern contents +are all themselves checked in other tests. Unicode, including property support, +is required for these tests. --/ -/\H\h\V\v/ - X X\x0a - X\x09X\x0b - ** Failers - \xa0 X\x0a - -/\H*\h+\V?\v{3,4}/ - \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a - \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a - \x09\x20\xa0\x0a\x0b\x0c - ** Failers - \x09\x20\xa0\x0a\x0b - -/\H{3,4}/ - XY ABCDE - XY PQR ST - -/.\h{3,4}./ - XY AB PQRS +/((?i)b)/BM -/\h*X\h?\H+Y\H?Z/ - >XNNNYZ - > X NYQZ - ** Failers - >XYZ - > X NY Z +/(?s)(.*X|^B)/BM -/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ - >XY\x0aZ\x0aA\x0bNN\x0c - >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c +/(?s:.*X|^B)/BM -/(foo)\Kbar/ - foobar - -/(foo)(\Kbar|baz)/ - foobar - foobaz +/^[[:alnum:]]/BM -/(foo\Kbar)baz/ - foobarbaz +/#/IxMD -/abc\K|def\K/g+ - Xabcdefghi +/a#/IxMD -/ab\Kc|de\Kf/g+ - Xabcdefghi - -/(?=C)/g+ - ABCDECBA - -/^abc\K/+ - abcdef - ** Failers - defabcxyz +/x?+/BM -/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ - ababababbbabZXXXX +/x++/BM -/(?tom|bon)-\g{A}/ - tom-tom - bon-bon - -/(^(a|b\g{-1}))/ - bacxxx +/x{1,3}+/BM -/(?|(abc)|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dr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|BM -/(?'abc'\w+):\g{abc}{2}/ - a:aaxyz - ab:ababxyz - ** Failers - a:axyz - ab:abxyz +/(a(?1)b)/BM -/^(?a)? (?()b|c) (?('ab')d|e)/x - abd - ce +/(a(?1)+b)/BM -/^(a.)\g-1Z/ - aXaXZ +/a(?Pb|c)d(?Pe)/BM -/^(a.)\g{-1}Z/ - aXaXZ +/(?:a(?Pc(?Pd)))(?Pa)/BM -/^(?(DEFINE) (? a) (? b) ) (?&A) (?&B) /x - abcd +/(?Pa)...(?P=a)bbb(?P>a)d/BM -/(?(?&NAME_PAT))\s+(?(?&ADDRESS_PAT)) - (?(DEFINE) - (?[a-z]+) - (?\d+) - )/x - metcalfe 33 +/abc(?C255)de(?C)f/BM -/(?(DEFINE)(?2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/ - 1.2.3.4 - 131.111.10.206 - 10.0.0.0 - ** Failers - 10.6 - 455.3.4.5 +/abcde/CBM -/\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/ - 1.2.3.4 - 131.111.10.206 - 10.0.0.0 - ** Failers - 10.6 - 455.3.4.5 +/\x{100}/8BM -/^(\w++|\s++)*$/ - now is the time for all good men to come to the aid of the party - *** Failers - this is not a line with only words and spaces! +/\x{1000}/8BM -/(\d++)(\w)/ - 12345a - *** Failers - 12345+ +/\x{10000}/8BM -/a++b/ - aaab +/\x{100000}/8BM -/(a++b)/ - aaab +/\x{10ffff}/8BM -/(a++)b/ - aaab +/\x{110000}/8BM -/([^()]++|\([^()]*\))+/ - ((abc(ade)ufh()()x +/[\x{ff}]/8BM -/\(([^()]++|\([^()]+\))+\)/ - (abc) - (abc(def)xyz) - *** Failers - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +/[\x{100}]/8BM -/^([^()]|\((?1)*\))*$/ - abc - a(b)c - a(b(c))d - *** Failers) - a(b(c)d +/\x80/8BM -/^>abc>([^()]|\((?1)*\))*abc>123abc>1(2)3abc>(1(2)3)]*+) | (?2)) * >))/x - <> - - hij> - hij> - def> - - *** Failers - a)(?<=b(?&X))/ - baz +/[\p{^L}]/BM -/^(?|(abc)|(def))\1/ - abcabc - defdef - ** Failers - abcdef - defabc - -/^(?|(abc)|(def))(?1)/ - abcabc - defabc - ** Failers - defdef - abcdef +/[\P{L}]/BM -/(?:a(? (?')|(?")) |b(? (?')|(?")) ) (?('quote')[a-z]+|[0-9]+)/xJ - a\"aaaaa - b\"aaaaa - ** Failers - b\"11111 +/[\P{^L}]/BM -/(?:(?1)|B)(A(*F)|C)/ - ABCD - CCD - ** Failers - CAD +/[abc\p{L}\x{0660}]/8BM -/^(?:(?1)|B)(A(*F)|C)/ - CCD - BCD - ** Failers - ABCD - CAD - BAD +/[\p{Nd}]/8BM -/(?:(?1)|B)(A(*ACCEPT)XX|C)D/ - AAD - ACD - BAD - BCD - BAX - ** Failers - ACX - ABC +/[\p{Nd}+-]+/8BM -/(?(DEFINE)(A))B(?1)C/ - BAC +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iBM -/(?(DEFINE)((A)\2))B(?1)C/ - BAAC +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8BM -/(? \( ( [^()]++ | (?&pn) )* \) )/x - (ab(cd)ef) +/[\x{105}-\x{109}]/8iBM -/^(?!a(*SKIP)b)/ - ac - -/^(?=a(*SKIP)b|ac)/ - ** Failers - ac - -/^(?=a(*THEN)b|ac)/ - ac - -/^(?=a(*PRUNE)b)/ - ab - ** Failers - ac +/( ( (?(1)0|) )* )/xBM -/^(?=a(*ACCEPT)b)/ - ac +/( (?(1)0|)* )/xBM -/^(?(?!a(*SKIP)b))/ - ac +/[a]/BM -/(?>a\Kb)/ - ab +/[a]/8BM -/((?>a\Kb))/ - ab +/[\xaa]/BM -/(a\Kb)/ - ab - -/^a\Kcz|ac/ - ac - -/(?>a\Kbz|ab)/ - ab +/[\xaa]/8BM -/^(?&t)(?(DEFINE)(?a\Kb))$/ - ab +/[^a]/BM -/^([^()]|\((?1)*\))*$/ - a(b)c - a(b(c)d)e +/[^a]/8BM -/(?P(?P0)(?P>L1)|(?P>L2))/ - 0 - 00 - 0000 +/[^\xaa]/BM -/(?P(?P0)|(?P>L2)(?P>L1))/ - 0 - 00 - 0000 +/[^\xaa]/8BM -/--- This one does fail, as expected, in Perl. It needs the complex item at the - end of the pattern. A single letter instead of (B|D) makes it not fail, - which I think is a Perl bug. --- / +/[^\d]/8WB -/A(*COMMIT)(B|D)/ - ACABX +/[[:^alpha:][:^cntrl:]]+/8WB -/--- Check the use of names for failure ---/ +/[[:^cntrl:][:^alpha:]]+/8WB -/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K - ** Failers - AC - CB - -/--- Force no study, otherwise mark is not seen. The studied version is in - test 2 because it isn't Perl-compatible. ---/ +/[[:alpha:]]+/8WB -/(*MARK:A)(*SKIP:B)(C|X)/KSS - C - D - -/^(A(*THEN:A)B|C(*THEN:B)D)/K - ** Failers - CB +/[[:^alpha:]\S]+/8WB -/^(?:A(*THEN:A)B|C(*THEN:B)D)/K - CB - -/^(?>A(*THEN:A)B|C(*THEN:B)D)/K - CB - -/--- This should succeed, as the skip causes bump to offset 1 (the mark). Note -that we have to have something complicated such as (B|Z) at the end because, -for Perl, a simple character somehow causes an unwanted optimization to mess -with the handling of backtracking verbs. ---/ - -/A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK - AAAC - -/--- Test skipping over a non-matching mark. ---/ - -/A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK - AAAC - -/--- Check shorthand for MARK ---/ - -/A(*:A)A+(*SKIP:A)(B|Z) | AC/xK - AAAC - -/--- Don't loop! Force no study, otherwise mark is not seen. ---/ - -/(*:A)A+(*SKIP:A)(B|Z)/KSS - AAAC - -/--- This should succeed, as a non-existent skip name disables the skip ---/ - -/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK - AAAC - -/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK - AAAC - -/--- COMMIT at the start of a pattern should act like an anchor. Again, -however, we need the complication for Perl. ---/ - -/(*COMMIT)(A|P)(B|P)(C|P)/ - ABCDEFG - ** Failers - DEFGABC - -/--- COMMIT inside an atomic group can't stop backtracking over the group. ---/ - -/(\w+)(?>b(*COMMIT))\w{2}/ - abbb - -/(\w+)b(*COMMIT)\w{2}/ - abbb - -/--- Check opening parens in comment when seeking forward reference. ---/ - -/(?&t)(?#()(?(DEFINE)(?a))/ - bac - -/--- COMMIT should override THEN ---/ - -/(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/ - yes - -/(?>(*COMMIT)(yes|no)(*THEN)(*F))?/ - yes - -/b?(*SKIP)c/ - bc - abc - -/(*SKIP)bc/ - a - -/(*SKIP)b/ - a - -/(?P(?P=abn)xxx|)+/ - xxx - -/(?i:([^b]))(?1)/ - aa - aA - ** Failers - ab - aB - Ba - ba - -/^(?&t)*+(?(DEFINE)(?a))\w$/ - aaaaaaX - ** Failers - aaaaaa - -/^(?&t)*(?(DEFINE)(?a))\w$/ - aaaaaaX - aaaaaa - -/^(a)*+(\w)/ - aaaaX - YZ - ** Failers - aaaa - -/^(?:a)*+(\w)/ - aaaaX - YZ - ** Failers - aaaa - -/^(a)++(\w)/ - aaaaX - ** Failers - aaaa - YZ - -/^(?:a)++(\w)/ - aaaaX - ** Failers - aaaa - YZ - -/^(a)?+(\w)/ - aaaaX - YZ - -/^(?:a)?+(\w)/ - aaaaX - YZ - -/^(a){2,}+(\w)/ - aaaaX - ** Failers - aaa - YZ - -/^(?:a){2,}+(\w)/ - aaaaX - ** Failers - aaa - YZ - -/(a|)*(?1)b/ - b - ab - aab - -/(a)++(?1)b/ - ** Failers - ab - aab - -/(a)*+(?1)b/ - ** Failers - ab - aab - -/(?1)(?:(b)){0}/ - b - -/(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x - foo(bar(baz)+baz(bop)) - -/(A (A|B(*ACCEPT)|C) D)(E)/x - AB - -/\A.*?(?:a|b(*THEN)c)/ - ba - -/\A.*?(?:a|bc)/ - ba - -/\A.*?(a|b(*THEN)c)/ - ba - -/\A.*?(a|bc)/ - ba - -/\A.*?(?:a|b(*THEN)c)++/ - ba - -/\A.*?(?:a|bc)++/ - ba - -/\A.*?(a|b(*THEN)c)++/ - ba - -/\A.*?(a|bc)++/ - ba - -/\A.*?(?:a|b(*THEN)c|d)/ - ba - -/\A.*?(?:a|bc|d)/ - ba - -/(?:(b))++/ - beetle - -/(?(?=(a(*ACCEPT)z))a)/ - a - -/^(a)(?1)+ab/ - aaaab - -/^(a)(?1)++ab/ - aaaab - -/^(?=a(*:M))aZ/K - aZbc - -/^(?!(*:M)b)aZ/K - aZbc - -/(?(DEFINE)(a))?b(?1)/ - backgammon - -/^\N+/ - abc\ndef - -/^\N{1,}/ - abc\ndef - -/(?(R)a+|(?R)b)/ - aaaabcde - -/(?(R)a+|((?R))b)/ - aaaabcde - -/((?(R)a+|(?1)b))/ - aaaabcde - -/((?(R1)a+|(?1)b))/ - aaaabcde - -/a(*:any -name)/K - abc - -/(?>(?&t)c|(?&t))(?(DEFINE)(?a|b(*PRUNE)c))/ - a - ba - bba - -/--- Checking revised (*THEN) handling ---/ - -/--- Capture ---/ - -/^.*? (a(*THEN)b) c/x - aabc - -/^.*? (a(*THEN)b|(*F)) c/x - aabc - -/^.*? ( (a(*THEN)b) | (*F) ) c/x - aabc - -/^.*? ( (a(*THEN)b) ) c/x - aabc - -/--- Non-capture ---/ - -/^.*? (?:a(*THEN)b) c/x - aabc - -/^.*? (?:a(*THEN)b|(*F)) c/x - aabc - -/^.*? (?: (?:a(*THEN)b) | (*F) ) c/x - aabc - -/^.*? (?: (?:a(*THEN)b) ) c/x - aabc - -/--- Atomic ---/ - -/^.*? (?>a(*THEN)b) c/x - aabc - -/^.*? (?>a(*THEN)b|(*F)) c/x - aabc - -/^.*? (?> (?>a(*THEN)b) | (*F) ) c/x - aabc - -/^.*? (?> (?>a(*THEN)b) ) c/x - aabc - -/--- Possessive capture ---/ - -/^.*? (a(*THEN)b)++ c/x - aabc - -/^.*? (a(*THEN)b|(*F))++ c/x - aabc - -/^.*? ( (a(*THEN)b)++ | (*F) )++ c/x - aabc - -/^.*? ( (a(*THEN)b)++ )++ c/x - aabc - -/--- Possessive non-capture ---/ - -/^.*? (?:a(*THEN)b)++ c/x - aabc - -/^.*? (?:a(*THEN)b|(*F))++ c/x - aabc - -/^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x - aabc - -/^.*? (?: (?:a(*THEN)b)++ )++ c/x - aabc - -/--- Condition assertion ---/ - -/^(?(?=a(*THEN)b)ab|ac)/ - ac - -/--- Condition ---/ - -/^.*?(?(?=a)a|b(*THEN)c)/ - ba - -/^.*?(?:(?(?=a)a|b(*THEN)c)|d)/ - ba - -/^.*?(?(?=a)a(*THEN)b|c)/ - ac - -/--- Assertion ---/ - -/^.*(?=a(*THEN)b)/ - aabc - -/------------------------------/ - -/(?>a(*:m))/imsxSK - a - -/(?>(a)(*:m))/imsxSK - a - -/(?<=a(*ACCEPT)b)c/ - xacd - -/(?<=(a(*ACCEPT)b))c/ - xacd - -/(?<=(a(*COMMIT)b))c/ - xabcd - ** Failers - xacd - -/(?