diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2009-09-15 19:11:48 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2009-09-15 19:11:48 +0000 |
commit | 00f5530723a69a9169033a6243575a9442624616 (patch) | |
tree | c0f2f4f723e9942362a5d681b29ca178e8f13900 | |
parent | 912ae74971cb3b32d007d9fa83295c38fc871b31 (diff) | |
download | pcre-00f5530723a69a9169033a6243575a9442624616.tar.gz |
Re-organize tests to make is possible to test 5.10 features against Perl.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@448 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rwxr-xr-x | RunTest | 40 | ||||
-rw-r--r-- | RunTest.bat | 4 | ||||
-rw-r--r-- | testdata/testinput11 | 253 | ||||
-rw-r--r-- | testdata/testinput12 | 199 | ||||
-rw-r--r-- | testdata/testinput2 | 283 | ||||
-rw-r--r-- | testdata/testinput6 | 199 | ||||
-rw-r--r-- | testdata/testoutput11 | 521 | ||||
-rw-r--r-- | testdata/testoutput12 | 467 | ||||
-rw-r--r-- | testdata/testoutput2 | 606 | ||||
-rw-r--r-- | testdata/testoutput6 | 467 |
12 files changed, 1680 insertions, 1366 deletions
@@ -128,6 +128,9 @@ Version 8.00 ??-???-?? make it do so. The string so far is captured, making this feature compatible with Perl. +23. The tests have been re-organized, adding tests 11 and 12, to make it + possible to check the Perl 5.10 features against Perl 5.10. + Version 7.9 11-Apr-09 --------------------- diff --git a/Makefile.am b/Makefile.am index 9783aa4..e6feeeb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -270,6 +270,8 @@ EXTRA_DIST += \ testdata/testinput8 \ testdata/testinput9 \ testdata/testinput10 \ + testdata/testinput11 \ + testdata/testinput12 \ testdata/testoutput1 \ testdata/testoutput2 \ testdata/testoutput3 \ @@ -280,6 +282,8 @@ EXTRA_DIST += \ testdata/testoutput8 \ testdata/testoutput9 \ testdata/testoutput10 \ + testdata/testoutput11 \ + testdata/testoutput12 \ testdata/wintestinput3 \ testdata/wintestoutput3 \ perltest.pl @@ -44,6 +44,8 @@ do7=no do8=no do9=no do10=no +do11=no +do12=no while [ $# -gt 0 ] ; do case $1 in @@ -57,6 +59,8 @@ while [ $# -gt 0 ] ; do 8) do8=yes;; 9) do9=yes;; 10) do10=yes;; + 11) do11=yes;; + 12) do12=yes;; valgrind) valgrind="valgrind -q";; *) echo "Unknown test number $1"; exit 1;; esac @@ -91,6 +95,10 @@ if [ $ucp -eq 0 ] ; then echo "Can't run test 10 because Unicode property support is not configured" exit 1 fi + if [ $do12 = yes ] ; then + echo "Can't run test 12 because Unicode property support is not configured" + exit 1 + fi fi if [ $link_size -ne 2 ] ; then @@ -104,7 +112,7 @@ fi if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ - $do9 = no -a $do10 = no ] ; then + $do9 = no -a $do10 = no -a $do11 = no -a $do12 = no ] ; then do1=yes do2=yes do3=yes @@ -115,6 +123,8 @@ if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ if [ $utf8 -ne 0 ] ; then do8=yes; fi if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do9=yes; fi if [ $link_size -eq 2 -a $ucp -ne 0 ] ; then do10=yes; fi + do11=yes + if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do12=yes; fi fi # Show which release @@ -227,7 +237,7 @@ if [ $do5 = yes ] ; then fi if [ $do6 = yes ] ; then - echo "Test 6: Unicode property support" + echo "Test 6: Unicode property support (Perl 5.10 compatible)" $valgrind ./pcretest -q $testdata/testinput6 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput6 testtry @@ -289,4 +299,30 @@ if [ $do10 = yes ] ; then echo "OK" fi +# Test of Perl 5.10 features + +if [ $do11 = yes ] ; then + echo "Test 11: Perl 5.10 features" + $valgrind ./pcretest -q $testdata/testinput11 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput11 testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" +fi + +# Test non-Perl-compatible Unicode property support + +if [ $do12 = yes ] ; then + echo "Test 12: API, internals, and non-Perl stuff for Unicode property support" + $valgrind ./pcretest -q $testdata/testinput12 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput12 testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" +fi + # End diff --git a/RunTest.bat b/RunTest.bat index 70517d0..8d29795 100644 --- a/RunTest.bat +++ b/RunTest.bat @@ -1,5 +1,5 @@ @rem This file was contributed by Ralf Junker, and touched up by -@rem Daniel Richard G. Test 10 added by Philip H. +@rem Daniel Richard G. Tests 10-12 added by Philip H. @rem Philip H also changed test 3 to use "wintest" files. @rem @rem MS Windows batch file to run pcretest on testfiles with the correct @@ -37,3 +37,5 @@ fc /n %srcdir%\testdata\testoutput7 testout\testoutput7 fc /n %srcdir%\testdata\testoutput8 testout\testoutput8 fc /n %srcdir%\testdata\testoutput9 testout\testoutput9 fc /n %srcdir%\testdata\testoutput10 testout\testoutput10 +fc /n %srcdir%\testdata\testoutput11 testout\testoutput11 +fc /n %srcdir%\testdata\testoutput12 testout\testoutput12 diff --git a/testdata/testinput11 b/testdata/testinput11 new file mode 100644 index 0000000..0518b68 --- /dev/null +++ b/testdata/testinput11 @@ -0,0 +1,253 @@ +/\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 + +/\h*X\h?\H+Y\H?Z/ + >XNNNYZ + > X NYQZ + ** Failers + >XYZ + > X NY Z + +/\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 + +/(foo)\Kbar/ + foobar + +/(foo)(\Kbar|baz)/ + foobar + foobaz + +/(foo\Kbar)baz/ + foobarbaz + +/abc\K|def\K/g+ + Xabcdefghi + +/ab\Kc|de\Kf/g+ + Xabcdefghi + +/(?=C)/g+ + ABCDECBA + +/^abc\K/+ + abcdef + ** Failers + defabcxyz + +/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ + ababababbbabZXXXX + +/(?<A>tom|bon)-\g{A}/ + tom-tom + bon-bon + +/(^(a|b\g{-1}))/ + bacxxx + +/(?|(abc)|(xyz))\1/ + abcabc + xyzxyz + ** Failers + abcxyz + xyzabc + +/(?|(abc)|(xyz))(?1)/ + abcabc + xyzabc + ** Failers + xyzxyz + +/^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/ + XYabcdY + +/^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/ + XYabcdY + +/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ + XYabcdY + +/(?'abc'\w+):\k<abc>{2}/ + a:aaxyz + ab:ababxyz + ** Failers + a:axyz + ab:abxyz + +/(?'abc'\w+):\g{abc}{2}/ + a:aaxyz + ab:ababxyz + ** Failers + a:axyz + ab:abxyz + +/^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x + abd + ce + +/^(a.)\g-1Z/ + aXaXZ + +/^(a.)\g{-1}Z/ + aXaXZ + +/^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x + abcd + +/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT)) + (?(DEFINE) + (?<NAME_PAT>[a-z]+) + (?<ADDRESS_PAT>\d+) + )/x + metcalfe 33 + +/(?(DEFINE)(?<byte>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 + +/\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>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 + +/^(\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! + +/(\d++)(\w)/ + 12345a + *** Failers + 12345+ + +/a++b/ + aaab + +/(a++b)/ + aaab + +/(a++)b/ + aaab + +/([^()]++|\([^()]*\))+/ + ((abc(ade)ufh()()x + +/\(([^()]++|\([^()]+\))+\)/ + (abc) + (abc(def)xyz) + *** Failers + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/^([^()]|\((?1)*\))*$/ + abc + a(b)c + a(b(c))d + *** Failers) + a(b(c)d + +/^>abc>([^()]|\((?1)*\))*<xyz<$/ + >abc>123<xyz< + >abc>1(2)3<xyz< + >abc>(1(2)3)<xyz< + +/^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i + 1221 + Satanoscillatemymetallicsonatas + AmanaplanacanalPanama + AblewasIereIsawElba + *** Failers + Thequickbrownfox + +/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ + 12 + (((2+2)*-3)-7) + -12 + *** Failers + ((2+2)*-3)-7) + +/^(x(y|(?1){2})z)/ + xyz + xxyzxyzz + *** Failers + xxyzz + xxyzxyzxyzz + +/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x + <> + <abcd> + <abc <123> hij> + <abc <def> hij> + <abc<>def> + <abc<> + *** Failers + <abc + +/^a+(*FAIL)/ + aaaaaa + +/a+b?c+(*FAIL)/ + aaabccc + +/a+b?(*PRUNE)c+(*FAIL)/ + aaabccc + +/a+b?(*COMMIT)c+(*FAIL)/ + aaabccc + +/a+b?(*SKIP)c+(*FAIL)/ + aaabcccaaabccc + +/^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ + aaaxxxxxx + aaa++++++ + bbbxxxxx + bbb+++++ + cccxxxx + ccc++++ + dddddddd + +/^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ + aaaxxxxxx + aaa++++++ + bbbxxxxx + bbb+++++ + cccxxxx + ccc++++ + dddddddd + +/a+b?(*THEN)c+(*FAIL)/ + aaabccc + +/(A (A|B(*ACCEPT)|C) D)(E)/x + ABX + AADE + ACDE + ** Failers + AD + +/ End of testinput11 / diff --git a/testdata/testinput12 b/testdata/testinput12 new file mode 100644 index 0000000..ae2ef10 --- /dev/null +++ b/testdata/testinput12 @@ -0,0 +1,199 @@ +/[\p{L}]/DZ + +/[\p{^L}]/DZ + +/[\P{L}]/DZ + +/[\P{^L}]/DZ + +/[abc\p{L}\x{0660}]/8DZ + +/[\p{Nd}]/8DZ + 1234 + +/[\p{Nd}+-]+/8DZ + 1234 + 12-34 + 12+\x{661}-34 + ** Failers + abcd + +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iDZ + +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8DZ + +/AB\x{1fb0}/8DZ + +/AB\x{1fb0}/8DZi + +/[\x{105}-\x{109}]/8iDZ + \x{104} + \x{105} + \x{109} + ** Failers + \x{100} + \x{10a} + +/[z-\x{100}]/8iDZ + Z + z + \x{39c} + \x{178} + | + \x{80} + \x{ff} + \x{100} + \x{101} + ** Failers + \x{102} + Y + y + +/[z-\x{100}]/8DZi + +/(?:[\PPa*]*){8,}/ + +/[\P{Any}]/BZ + +/[\P{Any}\E]/BZ + +/(\P{Yi}+\277)/ + +/(\P{Yi}+\277)?/ + +/(?<=\P{Yi}{3}A)X/ + +/\p{Yi}+(\P{Yi}+)(?1)/ + +/(\P{Yi}{2}\277)?/ + +/[\P{Yi}A]/ + +/[\P{Yi}\P{Yi}\P{Yi}A]/ + +/[^\P{Yi}A]/ + +/[^\P{Yi}\P{Yi}\P{Yi}A]/ + +/(\P{Yi}*\277)*/ + +/(\P{Yi}*?\277)*/ + +/(\p{Yi}*+\277)*/ + +/(\P{Yi}?\277)*/ + +/(\P{Yi}??\277)*/ + +/(\p{Yi}?+\277)*/ + +/(\P{Yi}{0,3}\277)*/ + +/(\P{Yi}{0,3}?\277)*/ + +/(\p{Yi}{0,3}+\277)*/ + +/\p{Zl}{2,3}+/8BZ + \xe2\x80\xa8\xe2\x80\xa8 + \x{2028}\x{2028}\x{2028} + +/\p{Zl}/8BZ + +/\p{Lu}{3}+/8BZ + +/\pL{2}+/8BZ + +/\p{Cc}{2}+/8BZ + +/^\p{Cs}/8 + \?\x{dfff} + ** Failers + \x{09f} + +/^\p{Sc}+/8 + $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6} + \x{9f2} + ** Failers + X + \x{2c2} + +/^\p{Zs}/8 + \ \ + \x{a0} + \x{1680} + \x{180e} + \x{2000} + \x{2001} + ** Failers + \x{2028} + \x{200d} + +/\p{^Lu}/8i + 1234 + ** Failers + ABC + +/\P{Lu}/8i + 1234 + ** Failers + ABC + +/\p{Ll}/8i + a + Az + ** Failers + ABC + +/\p{Lu}/8i + A + a\x{10a0}B + ** Failers + a + \x{1d00} + +/[\x{c0}\x{391}]/8i + \x{c0} + \x{e0} + +/The next two are special cases where the lengths of the different cases of the +same character differ. The first went wrong with heap frame storage; the 2nd +was broken in all cases./ + +/^\x{023a}+?(\x{0130}+)/8i + \x{023a}\x{2c65}\x{0130} + +/^\x{023a}+([^X])/8i + \x{023a}\x{2c65}X + +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + +/(\x{de})\1/8i + \x{de}\x{de} + \x{de}\x{fe} + \x{fe}\x{fe} + \x{fe}\x{de} + +/^\x{c0}$/8i + \x{c0} + \x{e0} + +/^\x{e0}$/8i + \x{c0} + \x{e0} + +/The next two should be Perl-compatible, but it fails to match \x{e0}. PCRE +will match it only with UCP support, because without that it has no notion +of case for anything other than the ASCII letters. / + +/((?i)[\x{c0}])/8 + \x{c0} + \x{e0} + +/(?i:[\x{c0}])/8 + \x{c0} + \x{e0} + diff --git a/testdata/testinput2 b/testdata/testinput2 index 5961e14..4fa1160 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -1915,13 +1915,6 @@ a random value. /Ix /(?=(?'abc'\w+))\k<abc>:/I abcd: -/(?'abc'\w+):\k<abc>{2}/ - a:aaxyz - ab:ababxyz - ** Failers - a:axyz - ab:abxyz - /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J adaa ** Failers @@ -1934,10 +1927,6 @@ a random value. /Ix ** Failers bddd -/^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x - abd - ce - /(?(<bc))/ /(?(''))/ @@ -1955,16 +1944,6 @@ a random value. /Ix /(?<1> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x abcabc1Xabc2XabcXabcabc -/^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x - abcd - -/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT)) - (?(DEFINE) - (?<NAME_PAT>[a-z]+) - (?<ADDRESS_PAT>\d+) - )/x - metcalfe 33 - /^(?(DEFINE) abc | xyz ) /x /(?(DEFINE) abc) xyz/xI @@ -2053,22 +2032,6 @@ a random value. /Ix /(?1)X(?<abc>P)/I abcPXP123 -/(?(DEFINE)(?<byte>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 - -/\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>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 - /(?:a(?&abc)b)*(?<abc>x)/ 123axbaxbaxbx456 123axbaxbaxb456 @@ -2090,9 +2053,6 @@ a random value. /Ix defabcabcxyz DEFabcABCXYZ -/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ - ababababbbabZXXXX - /^(a)\g-2/ /^(a)\g/ @@ -2191,26 +2151,12 @@ a random value. /Ix /^(?(+1)X|Y)(.)/BZ Y! -/(foo)\Kbar/ - foobar - -/(foo)(\Kbar|baz)/ - foobar - foobaz - -/(foo\Kbar)baz/ - foobarbaz - /(?<A>tom|bon)-\k{A}/ tom-tom bon-bon ** Failers tom-bon -/(?<A>tom|bon)-\g{A}/ - tom-tom - bon-bon - /\g{A/ /(?|(abc)|(xyz))/BZ @@ -2225,50 +2171,6 @@ a random value. /Ix xabcpqrx xxyzx -/(?|(abc)|(xyz))\1/ - abcabc - xyzxyz - ** Failers - abcxyz - xyzabc - -/(?|(abc)|(xyz))(?1)/ - abcabc - xyzabc - ** Failers - xyzxyz - -/\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 - -/\h*X\h?\H+Y\H?Z/ - >XNNNYZ - > X NYQZ - ** Failers - >XYZ - > X NY Z - -/\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 - /[\h]/BZ >\x09< @@ -2341,49 +2243,6 @@ a random value. /Ix /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/BZ -/^a+(*FAIL)/ - aaaaaa - -/a+b?c+(*FAIL)/ - aaabccc - -/a+b?(*PRUNE)c+(*FAIL)/ - aaabccc - -/a+b?(*COMMIT)c+(*FAIL)/ - aaabccc - -/a+b?(*SKIP)c+(*FAIL)/ - aaabcccaaabccc - -/^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ - aaaxxxxxx - aaa++++++ - bbbxxxxx - bbb+++++ - cccxxxx - ccc++++ - dddddddd - -/^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ - aaaxxxxxx - aaa++++++ - bbbxxxxx - bbb+++++ - cccxxxx - ccc++++ - dddddddd - -/a+b?(*THEN)c+(*FAIL)/ - aaabccc - -/(A (A|B(*ACCEPT)|C) D)(E)/x - ABX - AADE - ACDE - ** Failers - AD - /^a+(*FAIL)/C aaaaaa @@ -2589,66 +2448,8 @@ a random value. /Ix /[[:a\dz:]]/ -/^(?<name>a|b\g<name>c)/ - aaaa - bacxxx - bbaccxxx - bbbacccxx - -/^(?<name>a|b\g'name'c)/ - aaaa - bacxxx - bbaccxxx - bbbacccxx - -/^(a|b\g<1>c)/ - aaaa - bacxxx - bbaccxxx - bbbacccxx - -/^(a|b\g'1'c)/ - aaaa - bacxxx - bbaccxxx - bbbacccxx - -/^(a|b\g'-1'c)/ - aaaa - bacxxx - bbaccxxx - bbbacccxx - -/(^(a|b\g<-1>c))/ - aaaa - bacxxx - bbaccxxx - bbbacccxx - /(^(a|b\g<-1'c))/ -/(^(a|b\g{-1}))/ - bacxxx - -/(?-i:\g<name>)(?i:(?<name>a))/ - XaaX - XAAX - -/(?i:\g<name>)(?-i:(?<name>a))/ - XaaX - ** Failers - XAAX - -/(?-i:\g<+1>)(?i:(a))/ - XaaX - XAAX - -/(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/ - -/(?<n>a|b|c)\g<n>*/ - abc - accccbbb - /^(?+1)(?<a>x|y){0}z/ xzxx yzyy @@ -2755,24 +2556,12 @@ a random value. /Ix /^"((?(?=[a])[^"])|b)*"$/ "ab" -/^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/ - XYabcdY - /^X(?5)(a)(?|(b)|(q))(c)(d)Y/ XYabcdY /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/ XYabcdY -/^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/ - XYabcdY - -/^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/ - XYabcdY - -/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ - XYabcdY - /Xa{2,4}b/ X\P Xa\P @@ -2961,20 +2750,6 @@ a random value. /Ix /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ -/abc\K|def\K/g+ - Xabcdefghi - -/ab\Kc|de\Kf/g+ - Xabcdefghi - -/(?=C)/g+ - ABCDECBA - -/^abc\K/+ - abcdef - ** Failers - defabcxyz - /abc\K/+ abcdef abcdef\N\N @@ -3007,4 +2782,62 @@ a random value. /Ix xyz\N\N xyz\N +/^(?<name>a|b\g<name>c)/ + aaaa + bacxxx + bbaccxxx + bbbacccxx + +/^(?<name>a|b\g'name'c)/ + aaaa + bacxxx + bbaccxxx + bbbacccxx + +/^(a|b\g<1>c)/ + aaaa + bacxxx + bbaccxxx + bbbacccxx + +/^(a|b\g'1'c)/ + aaaa + bacxxx + bbaccxxx + bbbacccxx + +/^(a|b\g'-1'c)/ + aaaa + bacxxx + bbaccxxx + bbbacccxx + +/(^(a|b\g<-1>c))/ + aaaa + bacxxx + bbaccxxx + bbbacccxx + +/(?-i:\g<name>)(?i:(?<name>a))/ + XaaX + XAAX + +/(?i:\g<name>)(?-i:(?<name>a))/ + XaaX + ** Failers + XAAX + +/(?-i:\g<+1>)(?i:(a))/ + XaaX + XAAX + +/(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/ + +/(?<n>a|b|c)\g<n>*/ + abc + accccbbb + +/^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/ + XYabcdY + / End of testinput2 / diff --git a/testdata/testinput6 b/testdata/testinput6 index 628646d..f9cc5f7 100644 --- a/testdata/testinput6 +++ b/testdata/testinput6 @@ -60,11 +60,6 @@ ** Failers \x{09f} -/^\p{Cs}/8 - \?\x{dfff} - ** Failers - \x{09f} - /^\p{Ll}/8 a ** Failers @@ -199,13 +194,6 @@ } \x{f3b} -/^\p{Sc}+/8 - $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6} - \x{9f2} - ** Failers - X - \x{2c2} - /^\p{Sk}/8 \x{2c2} ** Failers @@ -237,17 +225,6 @@ X \x{2028} -/^\p{Zs}/8 - \ \ - \x{a0} - \x{1680} - \x{180e} - \x{2000} - \x{2001} - ** Failers - \x{2028} - \x{200d} - /\p{Nd}+(..)/8 \x{660}\x{661}\x{662}ABC @@ -291,23 +268,6 @@ ** Failers \x{660}\x{661}\x{662}ABC -/\p{Lu}/8i - A - a\x{10a0}B - ** Failers - a - \x{1d00} - -/\p{^Lu}/8i - 1234 - ** Failers - ABC - -/\P{Lu}/8i - 1234 - ** Failers - ABC - /(?<=A\p{Nd})XYZ/8 A2XYZ 123A5XYZPQR @@ -323,26 +283,6 @@ ** Failers WXYZ -/[\p{L}]/DZ - -/[\p{^L}]/DZ - -/[\P{L}]/DZ - -/[\P{^L}]/DZ - -/[abc\p{L}\x{0660}]/8DZ - -/[\p{Nd}]/8DZ - 1234 - -/[\p{Nd}+-]+/8DZ - 1234 - 12-34 - 12+\x{661}-34 - ** Failers - abcd - /[\P{Nd}]+/8 abcd ** Failers @@ -394,20 +334,6 @@ ** Failers ABC -/\p{Ll}/8i - a - Az - ** Failers - ABC - -/^\x{c0}$/8i - \x{c0} - \x{e0} - -/^\x{e0}$/8i - \x{c0} - \x{e0} - /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8 A\x{391}\x{10427}\x{ff3a}\x{1fb0} ** Failers @@ -425,14 +351,6 @@ A\x{391}\x{10427}\x{ff5a}\x{1fb0} A\x{391}\x{10427}\x{ff3a}\x{1fb8} -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iDZ - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8DZ - -/AB\x{1fb0}/8DZ - -/AB\x{1fb0}/8DZi - /\x{391}+/8i \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} @@ -448,35 +366,6 @@ \x{3b1} \x{ff5a} -/[\x{c0}\x{391}]/8i - \x{c0} - \x{e0} - -/[\x{105}-\x{109}]/8iDZ - \x{104} - \x{105} - \x{109} - ** Failers - \x{100} - \x{10a} - -/[z-\x{100}]/8iDZ - Z - z - \x{39c} - \x{178} - | - \x{80} - \x{ff} - \x{100} - \x{101} - ** Failers - \x{102} - Y - y - -/[z-\x{100}]/8DZi - /^\X/8 A A\x{300}BC @@ -747,31 +636,9 @@ /([\pL]=(abc))*X/ L=abcX -/The next two should be Perl-compatible, but it fails to match \x{e0}. PCRE -will match it only with UCP support, because without that it has no notion -of case for anything other than the ASCII letters. / - -/((?i)[\x{c0}])/8 - \x{c0} - \x{e0} - -/(?i:[\x{c0}])/8 - \x{c0} - \x{e0} - /^\p{Balinese}\p{Cuneiform}\p{Nko}\p{Phags_Pa}\p{Phoenician}/8 \x{1b00}\x{12000}\x{7c0}\x{a840}\x{10900} -/The next two are special cases where the lengths of the different cases of the -same character differ. The first went wrong with heap frame storage; the 2nd -was broken in all cases./ - -/^\x{023a}+?(\x{0130}+)/8i - \x{023a}\x{2c65}\x{0130} - -/^\x{023a}+([^X])/8i - \x{023a}\x{2c65}X - /Check property support in non-UTF-8 mode/ /\p{L}{4}/ @@ -790,48 +657,6 @@ was broken in all cases./ /[\PPP\x8a]{1,}\x80/ A\x80 -/(?:[\PPa*]*){8,}/ - -/[\P{Any}]/BZ - -/[\P{Any}\E]/BZ - -/(\P{Yi}+\277)/ - -/(\P{Yi}+\277)?/ - -/(?<=\P{Yi}{3}A)X/ - -/\p{Yi}+(\P{Yi}+)(?1)/ - -/(\P{Yi}{2}\277)?/ - -/[\P{Yi}A]/ - -/[\P{Yi}\P{Yi}\P{Yi}A]/ - -/[^\P{Yi}A]/ - -/[^\P{Yi}\P{Yi}\P{Yi}A]/ - -/(\P{Yi}*\277)*/ - -/(\P{Yi}*?\277)*/ - -/(\p{Yi}*+\277)*/ - -/(\P{Yi}?\277)*/ - -/(\P{Yi}??\277)*/ - -/(\p{Yi}?+\277)*/ - -/(\P{Yi}{0,3}\277)*/ - -/(\P{Yi}{0,3}?\277)*/ - -/(\p{Yi}{0,3}+\277)*/ - /^[\p{Arabic}]/8 \x{60e} \x{656} @@ -895,24 +720,6 @@ was broken in all cases./ \x{1049f} \x{104aa} -/\p{Zl}{2,3}+/8BZ - \xe2\x80\xa8\xe2\x80\xa8 - \x{2028}\x{2028}\x{2028} - -/\p{Zl}/8BZ - -/\p{Lu}{3}+/8BZ - -/\pL{2}+/8BZ - -/\p{Cc}{2}+/8BZ - -/\x{c0}+\x{116}+/8i - \x{c0}\x{e0}\x{116}\x{117} - -/[\x{c0}\x{116}]+/8i - \x{c0}\x{e0}\x{116}\x{117} - /\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== @@ -931,12 +738,6 @@ was broken in all cases./ aa aA -/(\x{de})\1/8i - \x{de}\x{de} - \x{de}\x{fe} - \x{fe}\x{fe} - \x{fe}\x{de} - /(\x{10a})\1/8i \x{10a}\x{10a} \x{10a}\x{10b} diff --git a/testdata/testoutput11 b/testdata/testoutput11 new file mode 100644 index 0000000..b2f0d7d --- /dev/null +++ b/testdata/testoutput11 @@ -0,0 +1,521 @@ +/\H\h\V\v/ + X X\x0a + 0: X X\x0a + X\x09X\x0b + 0: X\x09X\x0b + ** Failers +No match + \xa0 X\x0a +No match + +/\H*\h+\V?\v{3,4}/ + \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a + 0: \x09 \xa0X\x0a\x0b\x0c\x0d + \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a + 0: \x09 \xa0\x0a\x0b\x0c\x0d + \x09\x20\xa0\x0a\x0b\x0c + 0: \x09 \xa0\x0a\x0b\x0c + ** Failers +No match + \x09\x20\xa0\x0a\x0b +No match + +/\H{3,4}/ + XY ABCDE + 0: ABCD + XY PQR ST + 0: PQR + +/.\h{3,4}./ + XY AB PQRS + 0: B P + +/\h*X\h?\H+Y\H?Z/ + >XNNNYZ + 0: XNNNYZ + > X NYQZ + 0: X NYQZ + ** Failers +No match + >XYZ +No match + > X NY Z +No match + +/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ + >XY\x0aZ\x0aA\x0bNN\x0c + 0: XY\x0aZ\x0aA\x0bNN\x0c + >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c + 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c + +/(foo)\Kbar/ + foobar + 0: bar + 1: foo + +/(foo)(\Kbar|baz)/ + foobar + 0: bar + 1: foo + 2: bar + foobaz + 0: foobaz + 1: foo + 2: baz + +/(foo\Kbar)baz/ + foobarbaz + 0: barbaz + 1: foobar + +/abc\K|def\K/g+ + Xabcdefghi + 0: + 0+ defghi + 0: + 0+ ghi + +/ab\Kc|de\Kf/g+ + Xabcdefghi + 0: c + 0+ defghi + 0: f + 0+ ghi + +/(?=C)/g+ + ABCDECBA + 0: + 0+ CDECBA + 0: + 0+ CBA + +/^abc\K/+ + abcdef + 0: + 0+ def + ** Failers +No match + defabcxyz +No match + +/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ + ababababbbabZXXXX + 0: ababababbbabZ + 1: ab + 2: b + +/(?<A>tom|bon)-\g{A}/ + tom-tom + 0: tom-tom + 1: tom + bon-bon + 0: bon-bon + 1: bon + +/(^(a|b\g{-1}))/ + bacxxx +No match + +/(?|(abc)|(xyz))\1/ + abcabc + 0: abcabc + 1: abc + xyzxyz + 0: xyzxyz + 1: xyz + ** Failers +No match + abcxyz +No match + xyzabc +No match + +/(?|(abc)|(xyz))(?1)/ + abcabc + 0: abcabc + 1: abc + xyzabc + 0: xyzabc + 1: xyz + ** Failers +No match + xyzxyz +No match + +/^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/ + XYabcdY + 0: XYabcdY + 1: a + 2: b + 3: c + 4: d + 5: Y + +/^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/ + XYabcdY + 0: XYabcdY + 1: a + 2: b + 3: <unset> + 4: <unset> + 5: c + 6: d + 7: Y + +/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ + XYabcdY + 0: XYabcdY + 1: a + 2: b + 3: <unset> + 4: <unset> + 5: c + 6: d + 7: Y + +/(?'abc'\w+):\k<abc>{2}/ + a:aaxyz + 0: a:aa + 1: a + ab:ababxyz + 0: ab:abab + 1: ab + ** Failers +No match + a:axyz +No match + ab:abxyz +No match + +/(?'abc'\w+):\g{abc}{2}/ + a:aaxyz + 0: a:aa + 1: a + ab:ababxyz + 0: ab:abab + 1: ab + ** Failers +No match + a:axyz +No match + ab:abxyz +No match + +/^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x + abd + 0: abd + 1: a + ce + 0: ce + +/^(a.)\g-1Z/ + aXaXZ + 0: aXaXZ + 1: aX + +/^(a.)\g{-1}Z/ + aXaXZ + 0: aXaXZ + 1: aX + +/^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x + abcd + 0: ab + +/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT)) + (?(DEFINE) + (?<NAME_PAT>[a-z]+) + (?<ADDRESS_PAT>\d+) + )/x + metcalfe 33 + 0: metcalfe 33 + 1: metcalfe + 2: 33 + +/(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/ + 1.2.3.4 + 0: 1.2.3.4 + 1: <unset> + 2: .4 + 131.111.10.206 + 0: 131.111.10.206 + 1: <unset> + 2: .206 + 10.0.0.0 + 0: 10.0.0.0 + 1: <unset> + 2: .0 + ** Failers +No match + 10.6 +No match + 455.3.4.5 +No match + +/\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/ + 1.2.3.4 + 0: 1.2.3.4 + 1: .4 + 131.111.10.206 + 0: 131.111.10.206 + 1: .206 + 10.0.0.0 + 0: 10.0.0.0 + 1: .0 + ** Failers +No match + 10.6 +No match + 455.3.4.5 +No match + +/^(\w++|\s++)*$/ + now is the time for all good men to come to the aid of the party + 0: now is the time for all good men to come to the aid of the party + 1: party + *** Failers +No match + this is not a line with only words and spaces! +No match + +/(\d++)(\w)/ + 12345a + 0: 12345a + 1: 12345 + 2: a + *** Failers +No match + 12345+ +No match + +/a++b/ + aaab + 0: aaab + +/(a++b)/ + aaab + 0: aaab + 1: aaab + +/(a++)b/ + aaab + 0: aaab + 1: aaa + +/([^()]++|\([^()]*\))+/ + ((abc(ade)ufh()()x + 0: abc(ade)ufh()()x + 1: x + +/\(([^()]++|\([^()]+\))+\)/ + (abc) + 0: (abc) + 1: abc + (abc(def)xyz) + 0: (abc(def)xyz) + 1: xyz + *** Failers +No match + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/^([^()]|\((?1)*\))*$/ + abc + 0: abc + 1: c + a(b)c + 0: a(b)c + 1: c + a(b(c))d + 0: a(b(c))d + 1: d + *** Failers) +No match + a(b(c)d +No match + +/^>abc>([^()]|\((?1)*\))*<xyz<$/ + >abc>123<xyz< + 0: >abc>123<xyz< + 1: 3 + >abc>1(2)3<xyz< + 0: >abc>1(2)3<xyz< + 1: 3 + >abc>(1(2)3)<xyz< + 0: >abc>(1(2)3)<xyz< + 1: (1(2)3) + +/^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i + 1221 + 0: 1221 + 1: 1221 + 2: 1 + Satanoscillatemymetallicsonatas + 0: Satanoscillatemymetallicsonatas + 1: <unset> + 2: <unset> + 3: Satanoscillatemymetallicsonatas + 4: S + AmanaplanacanalPanama + 0: AmanaplanacanalPanama + 1: <unset> + 2: <unset> + 3: AmanaplanacanalPanama + 4: A + AblewasIereIsawElba + 0: AblewasIereIsawElba + 1: <unset> + 2: <unset> + 3: AblewasIereIsawElba + 4: A + *** Failers +No match + Thequickbrownfox +No match + +/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ + 12 + 0: 12 + 1: 12 + (((2+2)*-3)-7) + 0: (((2+2)*-3)-7) + 1: (((2+2)*-3)-7) + 2: - + -12 + 0: -12 + 1: -12 + *** Failers +No match + ((2+2)*-3)-7) +No match + +/^(x(y|(?1){2})z)/ + xyz + 0: xyz + 1: xyz + 2: y + xxyzxyzz + 0: xxyzxyzz + 1: xxyzxyzz + 2: xyzxyz + *** Failers +No match + xxyzz +No match + xxyzxyzxyzz +No match + +/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x + <> + 0: <> + 1: <> + 2: <> + <abcd> + 0: <abcd> + 1: <abcd> + 2: <abcd> + <abc <123> hij> + 0: <abc <123> hij> + 1: <abc <123> hij> + 2: <abc <123> hij> + <abc <def> hij> + 0: <def> + 1: <def> + 2: <def> + <abc<>def> + 0: <abc<>def> + 1: <abc<>def> + 2: <abc<>def> + <abc<> + 0: <> + 1: <> + 2: <> + *** Failers +No match + <abc +No match + +/^a+(*FAIL)/ + aaaaaa +No match + +/a+b?c+(*FAIL)/ + aaabccc +No match + +/a+b?(*PRUNE)c+(*FAIL)/ + aaabccc +No match + +/a+b?(*COMMIT)c+(*FAIL)/ + aaabccc +No match + +/a+b?(*SKIP)c+(*FAIL)/ + aaabcccaaabccc +No match + +/^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ + aaaxxxxxx + 0: aaaxxxxxx + aaa++++++ + 0: aaa + bbbxxxxx + 0: bbbxxxxx + bbb+++++ + 0: bbb + cccxxxx + 0: cccxxxx + ccc++++ + 0: ccc + dddddddd + 0: ddd + +/^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ + aaaxxxxxx + 0: aaaxxxxxx + 1: aaaxxxxxx + aaa++++++ + 0: aaa + 1: aaa + bbbxxxxx + 0: bbbxxxxx + 1: bbbxxxxx + bbb+++++ + 0: bbb + 1: bbb + cccxxxx + 0: cccxxxx + 1: cccxxxx + ccc++++ + 0: ccc + 1: ccc + dddddddd + 0: ddd + 1: ddd + +/a+b?(*THEN)c+(*FAIL)/ + aaabccc +No match + +/(A (A|B(*ACCEPT)|C) D)(E)/x + ABX + 0: AB + 1: AB + 2: B + AADE + 0: AADE + 1: AAD + 2: A + 3: E + ACDE + 0: ACDE + 1: ACD + 2: C + 3: E + ** Failers +No match + AD +No match + +/ End of testinput11 / diff --git a/testdata/testoutput12 b/testdata/testoutput12 new file mode 100644 index 0000000..454e2e1 --- /dev/null +++ b/testdata/testoutput12 @@ -0,0 +1,467 @@ +/[\p{L}]/DZ +------------------------------------------------------------------ + Bra + [\p{L}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[\p{^L}]/DZ +------------------------------------------------------------------ + Bra + [\P{L}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[\P{L}]/DZ +------------------------------------------------------------------ + Bra + [\P{L}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[\P{^L}]/DZ +------------------------------------------------------------------ + Bra + [\p{L}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[abc\p{L}\x{0660}]/8DZ +------------------------------------------------------------------ + Bra + [a-c\p{L}\x{660}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + +/[\p{Nd}]/8DZ +------------------------------------------------------------------ + Bra + [\p{Nd}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + 1234 + 0: 1 + +/[\p{Nd}+-]+/8DZ +------------------------------------------------------------------ + Bra + [+\-\p{Nd}]+ + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + 1234 + 0: 1234 + 12-34 + 0: 12-34 + 12+\x{661}-34 + 0: 12+\x{661}-34 + ** Failers +No match + abcd +No match + +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iDZ +------------------------------------------------------------------ + Bra + NC A\x{391}\x{10427}\x{ff3a}\x{1fb0} + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless utf8 +First char = 'A' (caseless) +No need char + +/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8DZ +------------------------------------------------------------------ + Bra + A\x{391}\x{10427}\x{ff3a}\x{1fb0} + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 'A' +Need char = 176 + +/AB\x{1fb0}/8DZ +------------------------------------------------------------------ + Bra + AB\x{1fb0} + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 'A' +Need char = 176 + +/AB\x{1fb0}/8DZi +------------------------------------------------------------------ + Bra + NC AB\x{1fb0} + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless utf8 +First char = 'A' (caseless) +Need char = 'B' (caseless) + +/[\x{105}-\x{109}]/8iDZ +------------------------------------------------------------------ + Bra + [\x{104}-\x{109}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless utf8 +No first char +No need char + \x{104} + 0: \x{104} + \x{105} + 0: \x{105} + \x{109} + 0: \x{109} + ** Failers +No match + \x{100} +No match + \x{10a} +No match + +/[z-\x{100}]/8iDZ +------------------------------------------------------------------ + Bra + [Z\x{39c}\x{178}z-\x{101}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless utf8 +No first char +No need char + Z + 0: Z + z + 0: z + \x{39c} + 0: \x{39c} + \x{178} + 0: \x{178} + | + 0: | + \x{80} + 0: \x{80} + \x{ff} + 0: \x{ff} + \x{100} + 0: \x{100} + \x{101} + 0: \x{101} + ** Failers +No match + \x{102} +No match + Y +No match + y +No match + +/[z-\x{100}]/8DZi +------------------------------------------------------------------ + Bra + [Z\x{39c}\x{178}z-\x{101}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless utf8 +No first char +No need char + +/(?:[\PPa*]*){8,}/ + +/[\P{Any}]/BZ +------------------------------------------------------------------ + Bra + [\P{Any}] + Ket + End +------------------------------------------------------------------ + +/[\P{Any}\E]/BZ +------------------------------------------------------------------ + Bra + [\P{Any}] + Ket + End +------------------------------------------------------------------ + +/(\P{Yi}+\277)/ + +/(\P{Yi}+\277)?/ + +/(?<=\P{Yi}{3}A)X/ + +/\p{Yi}+(\P{Yi}+)(?1)/ + +/(\P{Yi}{2}\277)?/ + +/[\P{Yi}A]/ + +/[\P{Yi}\P{Yi}\P{Yi}A]/ + +/[^\P{Yi}A]/ + +/[^\P{Yi}\P{Yi}\P{Yi}A]/ + +/(\P{Yi}*\277)*/ + +/(\P{Yi}*?\277)*/ + +/(\p{Yi}*+\277)*/ + +/(\P{Yi}?\277)*/ + +/(\P{Yi}??\277)*/ + +/(\p{Yi}?+\277)*/ + +/(\P{Yi}{0,3}\277)*/ + +/(\P{Yi}{0,3}?\277)*/ + +/(\p{Yi}{0,3}+\277)*/ + +/\p{Zl}{2,3}+/8BZ +------------------------------------------------------------------ + Bra + prop Zl {2} + prop Zl ?+ + Ket + End +------------------------------------------------------------------ + \xe2\x80\xa8\xe2\x80\xa8 + 0: \x{2028}\x{2028} + \x{2028}\x{2028}\x{2028} + 0: \x{2028}\x{2028}\x{2028} + +/\p{Zl}/8BZ +------------------------------------------------------------------ + Bra + prop Zl + Ket + End +------------------------------------------------------------------ + +/\p{Lu}{3}+/8BZ +------------------------------------------------------------------ + Bra + prop Lu {3} + Ket + End +------------------------------------------------------------------ + +/\pL{2}+/8BZ +------------------------------------------------------------------ + Bra + prop L {2} + Ket + End +------------------------------------------------------------------ + +/\p{Cc}{2}+/8BZ +------------------------------------------------------------------ + Bra + prop Cc {2} + Ket + End +------------------------------------------------------------------ + +/^\p{Cs}/8 + \?\x{dfff} + 0: \x{dfff} + ** Failers +No match + \x{09f} +No match + +/^\p{Sc}+/8 + $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6} + 0: $\x{a2}\x{a3}\x{a4}\x{a5} + \x{9f2} + 0: \x{9f2} + ** Failers +No match + X +No match + \x{2c2} +No match + +/^\p{Zs}/8 + \ \ + 0: + \x{a0} + 0: \x{a0} + \x{1680} + 0: \x{1680} + \x{180e} + 0: \x{180e} + \x{2000} + 0: \x{2000} + \x{2001} + 0: \x{2001} + ** Failers +No match + \x{2028} +No match + \x{200d} +No match + +/\p{^Lu}/8i + 1234 + 0: 1 + ** Failers + 0: * + ABC +No match + +/\P{Lu}/8i + 1234 + 0: 1 + ** Failers + 0: * + ABC +No match + +/\p{Ll}/8i + a + 0: a + Az + 0: z + ** Failers + 0: a + ABC +No match + +/\p{Lu}/8i + A + 0: A + a\x{10a0}B + 0: \x{10a0} + ** Failers + 0: F + a +No match + \x{1d00} +No match + +/[\x{c0}\x{391}]/8i + \x{c0} + 0: \x{c0} + \x{e0} + 0: \x{e0} + +/The next two are special cases where the lengths of the different cases of the +same character differ. The first went wrong with heap frame storage; the 2nd +was broken in all cases./ + +/^\x{023a}+?(\x{0130}+)/8i + \x{023a}\x{2c65}\x{0130} + 0: \x{23a}\x{2c65}\x{130} + 1: \x{130} + +/^\x{023a}+([^X])/8i + \x{023a}\x{2c65}X + 0: \x{23a}\x{2c65} + 1: \x{2c65} + +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + +/(\x{de})\1/8i + \x{de}\x{de} + 0: \x{de}\x{de} + 1: \x{de} + \x{de}\x{fe} + 0: \x{de}\x{fe} + 1: \x{de} + \x{fe}\x{fe} + 0: \x{fe}\x{fe} + 1: \x{fe} + \x{fe}\x{de} + 0: \x{fe}\x{de} + 1: \x{fe} + +/^\x{c0}$/8i + \x{c0} + 0: \x{c0} + \x{e0} + 0: \x{e0} + +/^\x{e0}$/8i + \x{c0} + 0: \x{c0} + \x{e0} + 0: \x{e0} + +/The next two should be Perl-compatible, but it fails to match \x{e0}. PCRE +will match it only with UCP support, because without that it has no notion +of case for anything other than the ASCII letters. / + +/((?i)[\x{c0}])/8 + \x{c0} + 0: \x{c0} + 1: \x{c0} + \x{e0} + 0: \x{e0} + 1: \x{e0} + +/(?i:[\x{c0}])/8 + \x{c0} + 0: \x{c0} + \x{e0} + 0: \x{e0} + diff --git a/testdata/testoutput2 b/testdata/testoutput2 index f84c3ca..f223df0 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -1805,7 +1805,6 @@ Need char = ')' 0: (abcd(xyz<p>qrs)123) 1: abcd(xyz<p>qrs)123 2: 123 - 3: <unset> /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix Capturing subpattern count = 3 @@ -7572,20 +7571,6 @@ Need char = ':' 0: abcd: 1: abcd -/(?'abc'\w+):\k<abc>{2}/ - a:aaxyz - 0: a:aa - 1: a - ab:ababxyz - 0: ab:abab - 1: ab - ** Failers -No match - a:axyz -No match - ab:abxyz -No match - /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J adaa 0: adaa @@ -7612,13 +7597,6 @@ No match bddd No match -/^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x - abd - 0: abd - 1: a - ce - 0: ce - /(?(<bc))/ Failed: malformed number or name after (?( at offset 6 @@ -7649,24 +7627,6 @@ Failed: reference to non-existent subpattern at offset 29 1: abcabc1Xabc2XabcX 2: abcabc1Xabc2XabcX -/^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x - abcd - 0: ab - 1: <unset> - 2: <unset> - -/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT)) - (?(DEFINE) - (?<NAME_PAT>[a-z]+) - (?<ADDRESS_PAT>\d+) - )/x - metcalfe 33 - 0: metcalfe 33 - 1: metcalfe - 2: 33 - 3: <unset> - 4: <unset> - /^(?(DEFINE) abc | xyz ) /x Failed: DEFINE group contains more than one branch at offset 22 @@ -7844,46 +7804,6 @@ Need char = 'P' 0: PXP 1: P -/(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/ - 1.2.3.4 - 0: 1.2.3.4 - 1: <unset> - 2: .4 - 131.111.10.206 - 0: 131.111.10.206 - 1: <unset> - 2: .206 - 10.0.0.0 - 0: 10.0.0.0 - 1: <unset> - 2: .0 - ** Failers -No match - 10.6 -No match - 455.3.4.5 -No match - -/\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/ - 1.2.3.4 - 0: 1.2.3.4 - 1: .4 - 2: <unset> - 131.111.10.206 - 0: 131.111.10.206 - 1: .206 - 2: <unset> - 10.0.0.0 - 0: 10.0.0.0 - 1: .0 - 2: <unset> - ** Failers -No match - 10.6 -No match - 455.3.4.5 -No match - /(?:a(?&abc)b)*(?<abc>x)/ 123axbaxbaxbx456 0: axbaxbaxbx @@ -7921,12 +7841,6 @@ No match DEFabcABCXYZ No match -/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ - ababababbbabZXXXX - 0: ababababbbabZ - 1: ab - 2: b - /^(a)\g-2/ Failed: reference to non-existent subpattern at offset 7 @@ -8182,26 +8096,6 @@ Failed: reference to non-existent subpattern at offset 7 0: Y! 1: ! -/(foo)\Kbar/ - foobar - 0: bar - 1: foo - -/(foo)(\Kbar|baz)/ - foobar - 0: bar - 1: foo - 2: bar - foobaz - 0: foobaz - 1: foo - 2: baz - -/(foo\Kbar)baz/ - foobarbaz - 0: barbaz - 1: foobar - /(?<A>tom|bon)-\k{A}/ tom-tom 0: tom-tom @@ -8214,14 +8108,6 @@ No match tom-bon No match -/(?<A>tom|bon)-\g{A}/ - tom-tom - 0: tom-tom - 1: tom - bon-bon - 0: bon-bon - 1: bon - /\g{A/ Failed: syntax error in subpattern name (missing terminator) at offset 4 @@ -8316,82 +8202,6 @@ Failed: syntax error in subpattern name (missing terminator) at offset 4 3: <unset> 4: x -/(?|(abc)|(xyz))\1/ - abcabc - 0: abcabc - 1: abc - xyzxyz - 0: xyzxyz - 1: xyz - ** Failers -No match - abcxyz -No match - xyzabc -No match - -/(?|(abc)|(xyz))(?1)/ - abcabc - 0: abcabc - 1: abc - xyzabc - 0: xyzabc - 1: xyz - ** Failers -No match - xyzxyz -No match - -/\H\h\V\v/ - X X\x0a - 0: X X\x0a - X\x09X\x0b - 0: X\x09X\x0b - ** Failers -No match - \xa0 X\x0a -No match - -/\H*\h+\V?\v{3,4}/ - \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a - 0: \x09 \xa0X\x0a\x0b\x0c\x0d - \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a - 0: \x09 \xa0\x0a\x0b\x0c\x0d - \x09\x20\xa0\x0a\x0b\x0c - 0: \x09 \xa0\x0a\x0b\x0c - ** Failers -No match - \x09\x20\xa0\x0a\x0b -No match - -/\H{3,4}/ - XY ABCDE - 0: ABCD - XY PQR ST - 0: PQR - -/.\h{3,4}./ - XY AB PQRS - 0: B P - -/\h*X\h?\H+Y\H?Z/ - >XNNNYZ - 0: XNNNYZ - > X NYQZ - 0: X NYQZ - ** Failers -No match - >XYZ -No match - > X NY Z -No match - -/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ - >XY\x0aZ\x0aA\x0bNN\x0c - 0: XY\x0aZ\x0aA\x0bNN\x0c - >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c - 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c - /[\h]/BZ ------------------------------------------------------------------ Bra @@ -8688,87 +8498,6 @@ Failed: missing terminating ] for character class at offset 10 End ------------------------------------------------------------------ -/^a+(*FAIL)/ - aaaaaa -No match - -/a+b?c+(*FAIL)/ - aaabccc -No match - -/a+b?(*PRUNE)c+(*FAIL)/ - aaabccc -No match - -/a+b?(*COMMIT)c+(*FAIL)/ - aaabccc -No match - -/a+b?(*SKIP)c+(*FAIL)/ - aaabcccaaabccc -No match - -/^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ - aaaxxxxxx - 0: aaaxxxxxx - aaa++++++ - 0: aaa - bbbxxxxx - 0: bbbxxxxx - bbb+++++ - 0: bbb - cccxxxx - 0: cccxxxx - ccc++++ - 0: ccc - dddddddd - 0: ddd - -/^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ - aaaxxxxxx - 0: aaaxxxxxx - 1: aaaxxxxxx - aaa++++++ - 0: aaa - 1: aaa - bbbxxxxx - 0: bbbxxxxx - 1: bbbxxxxx - bbb+++++ - 0: bbb - 1: bbb - cccxxxx - 0: cccxxxx - 1: cccxxxx - ccc++++ - 0: ccc - 1: ccc - dddddddd - 0: ddd - 1: ddd - -/a+b?(*THEN)c+(*FAIL)/ - aaabccc -No match - -/(A (A|B(*ACCEPT)|C) D)(E)/x - ABX - 0: AB - AADE - 0: AADE - 1: AAD - 2: A - 3: E - ACDE - 0: ACDE - 1: ACD - 2: C - 3: E - ** Failers -No match - AD -No match - /^a+(*FAIL)/C aaaaaa --->aaaaaa @@ -9240,143 +8969,14 @@ Failed: unknown POSIX class name at offset 6 /[[:a\dz:]]/ Failed: unknown POSIX class name at offset 3 -/^(?<name>a|b\g<name>c)/ - aaaa - 0: a - 1: a - bacxxx - 0: bac - 1: bac - bbaccxxx - 0: bbacc - 1: bbacc - bbbacccxx - 0: bbbaccc - 1: bbbaccc - -/^(?<name>a|b\g'name'c)/ - aaaa - 0: a - 1: a - bacxxx - 0: bac - 1: bac - bbaccxxx - 0: bbacc - 1: bbacc - bbbacccxx - 0: bbbaccc - 1: bbbaccc - -/^(a|b\g<1>c)/ - aaaa - 0: a - 1: a - bacxxx - 0: bac - 1: bac - bbaccxxx - 0: bbacc - 1: bbacc - bbbacccxx - 0: bbbaccc - 1: bbbaccc - -/^(a|b\g'1'c)/ - aaaa - 0: a - 1: a - bacxxx - 0: bac - 1: bac - bbaccxxx - 0: bbacc - 1: bbacc - bbbacccxx - 0: bbbaccc - 1: bbbaccc - -/^(a|b\g'-1'c)/ - aaaa - 0: a - 1: a - bacxxx - 0: bac - 1: bac - bbaccxxx - 0: bbacc - 1: bbacc - bbbacccxx - 0: bbbaccc - 1: bbbaccc - -/(^(a|b\g<-1>c))/ - aaaa - 0: a - 1: a - 2: a - bacxxx - 0: bac - 1: bac - 2: bac - bbaccxxx - 0: bbacc - 1: bbacc - 2: bbacc - bbbacccxx - 0: bbbaccc - 1: bbbaccc - 2: bbbaccc - /(^(a|b\g<-1'c))/ Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15 -/(^(a|b\g{-1}))/ - bacxxx -No match - -/(?-i:\g<name>)(?i:(?<name>a))/ - XaaX - 0: aa - 1: a - XAAX - 0: AA - 1: A - -/(?i:\g<name>)(?-i:(?<name>a))/ - XaaX - 0: aa - 1: a - ** Failers -No match - XAAX -No match - -/(?-i:\g<+1>)(?i:(a))/ - XaaX - 0: aa - 1: a - XAAX - 0: AA - 1: A - -/(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/ - -/(?<n>a|b|c)\g<n>*/ - abc - 0: abc - 1: a - accccbbb - 0: accccbbb - 1: a - /^(?+1)(?<a>x|y){0}z/ xzxx 0: xz - 1: <unset> yzyy 0: yz - 1: <unset> ** Failers No match xxz @@ -9638,15 +9238,6 @@ No match 0: "ab" 1: -/^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/ - XYabcdY - 0: XYabcdY - 1: a - 2: b - 3: c - 4: d - 5: Y - /^X(?5)(a)(?|(b)|(q))(c)(d)Y/ Failed: reference to non-existent subpattern at offset 5 @@ -9659,39 +9250,6 @@ Failed: reference to non-existent subpattern at offset 5 4: d 5: Y -/^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/ - XYabcdY - 0: XYabcdY - 1: a - 2: b - 3: <unset> - 4: <unset> - 5: c - 6: d - 7: Y - -/^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/ - XYabcdY - 0: XYabcdY - 1: a - 2: b - 3: <unset> - 4: <unset> - 5: c - 6: d - 7: Y - -/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ - XYabcdY - 0: XYabcdY - 1: a - 2: b - 3: <unset> - 4: <unset> - 5: c - 6: d - 7: Y - /Xa{2,4}b/ X\P Partial match: X @@ -10048,36 +9606,6 @@ Partial match: +ab End ------------------------------------------------------------------ -/abc\K|def\K/g+ - Xabcdefghi - 0: - 0+ defghi - 0: - 0+ ghi - -/ab\Kc|de\Kf/g+ - Xabcdefghi - 0: c - 0+ defghi - 0: f - 0+ ghi - -/(?=C)/g+ - ABCDECBA - 0: - 0+ CDECBA - 0: - 0+ CBA - -/^abc\K/+ - abcdef - 0: - 0+ def - ** Failers -No match - defabcxyz -No match - /abc\K/+ abcdef 0: @@ -10148,4 +9676,138 @@ No match xyz\N No match +/^(?<name>a|b\g<name>c)/ + aaaa + 0: a + 1: a + bacxxx + 0: bac + 1: bac + bbaccxxx + 0: bbacc + 1: bbacc + bbbacccxx + 0: bbbaccc + 1: bbbaccc + +/^(?<name>a|b\g'name'c)/ + aaaa + 0: a + 1: a + bacxxx + 0: bac + 1: bac + bbaccxxx + 0: bbacc + 1: bbacc + bbbacccxx + 0: bbbaccc + 1: bbbaccc + +/^(a|b\g<1>c)/ + aaaa + 0: a + 1: a + bacxxx + 0: bac + 1: bac + bbaccxxx + 0: bbacc + 1: bbacc + bbbacccxx + 0: bbbaccc + 1: bbbaccc + +/^(a|b\g'1'c)/ + aaaa + 0: a + 1: a + bacxxx + 0: bac + 1: bac + bbaccxxx + 0: bbacc + 1: bbacc + bbbacccxx + 0: bbbaccc + 1: bbbaccc + +/^(a|b\g'-1'c)/ + aaaa + 0: a + 1: a + bacxxx + 0: bac + 1: bac + bbaccxxx + 0: bbacc + 1: bbacc + bbbacccxx + 0: bbbaccc + 1: bbbaccc + +/(^(a|b\g<-1>c))/ + aaaa + 0: a + 1: a + 2: a + bacxxx + 0: bac + 1: bac + 2: bac + bbaccxxx + 0: bbacc + 1: bbacc + 2: bbacc + bbbacccxx + 0: bbbaccc + 1: bbbaccc + 2: bbbaccc + +/(?-i:\g<name>)(?i:(?<name>a))/ + XaaX + 0: aa + 1: a + XAAX + 0: AA + 1: A + +/(?i:\g<name>)(?-i:(?<name>a))/ + XaaX + 0: aa + 1: a + ** Failers +No match + XAAX +No match + +/(?-i:\g<+1>)(?i:(a))/ + XaaX + 0: aa + 1: a + XAAX + 0: AA + 1: A + +/(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/ + +/(?<n>a|b|c)\g<n>*/ + abc + 0: abc + 1: a + accccbbb + 0: accccbbb + 1: a + +/^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/ + XYabcdY + 0: XYabcdY + 1: a + 2: b + 3: <unset> + 4: <unset> + 5: c + 6: d + 7: Y + / End of testinput2 / diff --git a/testdata/testoutput6 b/testdata/testoutput6 index 401f5e7..722a73c 100644 --- a/testdata/testoutput6 +++ b/testdata/testoutput6 @@ -98,14 +98,6 @@ No match \x{09f} No match -/^\p{Cs}/8 - \?\x{dfff} - 0: \x{dfff} - ** Failers -No match - \x{09f} -No match - /^\p{Ll}/8 a 0: a @@ -338,18 +330,6 @@ No match \x{f3b} No match -/^\p{Sc}+/8 - $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6} - 0: $\x{a2}\x{a3}\x{a4}\x{a5} - \x{9f2} - 0: \x{9f2} - ** Failers -No match - X -No match - \x{2c2} -No match - /^\p{Sk}/8 \x{2c2} 0: \x{2c2} @@ -402,26 +382,6 @@ No match \x{2028} No match -/^\p{Zs}/8 - \ \ - 0: - \x{a0} - 0: \x{a0} - \x{1680} - 0: \x{1680} - \x{180e} - 0: \x{180e} - \x{2000} - 0: \x{2000} - \x{2001} - 0: \x{2001} - ** Failers -No match - \x{2028} -No match - \x{200d} -No match - /\p{Nd}+(..)/8 \x{660}\x{661}\x{662}ABC 0: \x{660}\x{661}\x{662}AB @@ -494,34 +454,6 @@ No match \x{660}\x{661}\x{662}ABC No match -/\p{Lu}/8i - A - 0: A - a\x{10a0}B - 0: \x{10a0} - ** Failers - 0: F - a -No match - \x{1d00} -No match - -/\p{^Lu}/8i - 1234 - 0: 1 - ** Failers - 0: * - ABC -No match - -/\P{Lu}/8i - 1234 - 0: 1 - ** Failers - 0: * - ABC -No match - /(?<=A\p{Nd})XYZ/8 A2XYZ 0: XYZ @@ -548,102 +480,6 @@ No match WXYZ No match -/[\p{L}]/DZ ------------------------------------------------------------------- - Bra - [\p{L}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[\p{^L}]/DZ ------------------------------------------------------------------- - Bra - [\P{L}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[\P{L}]/DZ ------------------------------------------------------------------- - Bra - [\P{L}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[\P{^L}]/DZ ------------------------------------------------------------------- - Bra - [\p{L}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[abc\p{L}\x{0660}]/8DZ ------------------------------------------------------------------- - Bra - [a-c\p{L}\x{660}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - -/[\p{Nd}]/8DZ ------------------------------------------------------------------- - Bra - [\p{Nd}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - 1234 - 0: 1 - -/[\p{Nd}+-]+/8DZ ------------------------------------------------------------------- - Bra - [+\-\p{Nd}]+ - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - 1234 - 0: 1234 - 12-34 - 0: 12-34 - 12+\x{661}-34 - 0: 12+\x{661}-34 - ** Failers -No match - abcd -No match - /[\P{Nd}]+/8 abcd 0: abcd @@ -724,28 +560,6 @@ No match ABC No match -/\p{Ll}/8i - a - 0: a - Az - 0: z - ** Failers - 0: a - ABC -No match - -/^\x{c0}$/8i - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - -/^\x{e0}$/8i - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8 A\x{391}\x{10427}\x{ff3a}\x{1fb0} 0: A\x{391}\x{10427}\x{ff3a}\x{1fb0} @@ -776,54 +590,6 @@ No match A\x{391}\x{10427}\x{ff3a}\x{1fb8} 0: A\x{391}\x{10427}\x{ff3a}\x{1fb8} -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iDZ ------------------------------------------------------------------- - Bra - NC A\x{391}\x{10427}\x{ff3a}\x{1fb0} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -First char = 'A' (caseless) -No need char - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8DZ ------------------------------------------------------------------- - Bra - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 'A' -Need char = 176 - -/AB\x{1fb0}/8DZ ------------------------------------------------------------------- - Bra - AB\x{1fb0} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 'A' -Need char = 176 - -/AB\x{1fb0}/8DZi ------------------------------------------------------------------- - Bra - NC AB\x{1fb0} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -First char = 'A' (caseless) -Need char = 'B' (caseless) - /\x{391}+/8i \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} 0: \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} @@ -848,86 +614,6 @@ Need char = 'B' (caseless) \x{ff5a} 0: \x{ff5a} -/[\x{c0}\x{391}]/8i - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - -/[\x{105}-\x{109}]/8iDZ ------------------------------------------------------------------- - Bra - [\x{104}-\x{109}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -No first char -No need char - \x{104} - 0: \x{104} - \x{105} - 0: \x{105} - \x{109} - 0: \x{109} - ** Failers -No match - \x{100} -No match - \x{10a} -No match - -/[z-\x{100}]/8iDZ ------------------------------------------------------------------- - Bra - [Z\x{39c}\x{178}z-\x{101}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -No first char -No need char - Z - 0: Z - z - 0: z - \x{39c} - 0: \x{39c} - \x{178} - 0: \x{178} - | - 0: | - \x{80} - 0: \x{80} - \x{ff} - 0: \x{ff} - \x{100} - 0: \x{100} - \x{101} - 0: \x{101} - ** Failers -No match - \x{102} -No match - Y -No match - y -No match - -/[z-\x{100}]/8DZi ------------------------------------------------------------------- - Bra - [Z\x{39c}\x{178}z-\x{101}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: caseless utf8 -No first char -No need char - /^\X/8 A 0: A @@ -1407,42 +1093,10 @@ No match 1: L=abc 2: abc -/The next two should be Perl-compatible, but it fails to match \x{e0}. PCRE -will match it only with UCP support, because without that it has no notion -of case for anything other than the ASCII letters. / - -/((?i)[\x{c0}])/8 - \x{c0} - 0: \x{c0} - 1: \x{c0} - \x{e0} - 0: \x{e0} - 1: \x{e0} - -/(?i:[\x{c0}])/8 - \x{c0} - 0: \x{c0} - \x{e0} - 0: \x{e0} - /^\p{Balinese}\p{Cuneiform}\p{Nko}\p{Phags_Pa}\p{Phoenician}/8 \x{1b00}\x{12000}\x{7c0}\x{a840}\x{10900} 0: \x{1b00}\x{12000}\x{7c0}\x{a840}\x{10900} -/The next two are special cases where the lengths of the different cases of the -same character differ. The first went wrong with heap frame storage; the 2nd -was broken in all cases./ - -/^\x{023a}+?(\x{0130}+)/8i - \x{023a}\x{2c65}\x{0130} - 0: \x{23a}\x{2c65}\x{130} - 1: \x{130} - -/^\x{023a}+([^X])/8i - \x{023a}\x{2c65}X - 0: \x{23a}\x{2c65} - 1: \x{2c65} - /Check property support in non-UTF-8 mode/ /\p{L}{4}/ @@ -1467,60 +1121,6 @@ No match A\x80 0: A\x80 -/(?:[\PPa*]*){8,}/ - -/[\P{Any}]/BZ ------------------------------------------------------------------- - Bra - [\P{Any}] - Ket - End ------------------------------------------------------------------- - -/[\P{Any}\E]/BZ ------------------------------------------------------------------- - Bra - [\P{Any}] - Ket - End ------------------------------------------------------------------- - -/(\P{Yi}+\277)/ - -/(\P{Yi}+\277)?/ - -/(?<=\P{Yi}{3}A)X/ - -/\p{Yi}+(\P{Yi}+)(?1)/ - -/(\P{Yi}{2}\277)?/ - -/[\P{Yi}A]/ - -/[\P{Yi}\P{Yi}\P{Yi}A]/ - -/[^\P{Yi}A]/ - -/[^\P{Yi}\P{Yi}\P{Yi}A]/ - -/(\P{Yi}*\277)*/ - -/(\P{Yi}*?\277)*/ - -/(\p{Yi}*+\277)*/ - -/(\P{Yi}?\277)*/ - -/(\P{Yi}??\277)*/ - -/(\p{Yi}?+\277)*/ - -/(\P{Yi}{0,3}\277)*/ - -/(\P{Yi}{0,3}?\277)*/ - -/(\p{Yi}{0,3}+\277)*/ - /^[\p{Arabic}]/8 \x{60e} 0: \x{60e} @@ -1633,59 +1233,6 @@ No match \x{104aa} No match -/\p{Zl}{2,3}+/8BZ ------------------------------------------------------------------- - Bra - prop Zl {2} - prop Zl ?+ - Ket - End ------------------------------------------------------------------- - \xe2\x80\xa8\xe2\x80\xa8 - 0: \x{2028}\x{2028} - \x{2028}\x{2028}\x{2028} - 0: \x{2028}\x{2028}\x{2028} - -/\p{Zl}/8BZ ------------------------------------------------------------------- - Bra - prop Zl - Ket - End ------------------------------------------------------------------- - -/\p{Lu}{3}+/8BZ ------------------------------------------------------------------- - Bra - prop Lu {3} - Ket - End ------------------------------------------------------------------- - -/\pL{2}+/8BZ ------------------------------------------------------------------- - Bra - prop L {2} - Ket - End ------------------------------------------------------------------- - -/\p{Cc}{2}+/8BZ ------------------------------------------------------------------- - Bra - prop Cc {2} - Ket - End ------------------------------------------------------------------- - -/\x{c0}+\x{116}+/8i - \x{c0}\x{e0}\x{116}\x{117} - 0: \x{c0}\x{e0}\x{116}\x{117} - -/[\x{c0}\x{116}]+/8i - \x{c0}\x{e0}\x{116}\x{117} - 0: \x{c0}\x{e0}\x{116}\x{117} - /\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== 0: \x{102a4}\x{aa52}\x{a91d}\x{1c46}\x{10283}\x{1092e}\x{1c6b}\x{a93b}\x{a8bf}\x{1ba0}\x{a50a} @@ -1718,20 +1265,6 @@ No match 0: aA 1: a -/(\x{de})\1/8i - \x{de}\x{de} - 0: \x{de}\x{de} - 1: \x{de} - \x{de}\x{fe} - 0: \x{de}\x{fe} - 1: \x{de} - \x{fe}\x{fe} - 0: \x{fe}\x{fe} - 1: \x{fe} - \x{fe}\x{de} - 0: \x{fe}\x{de} - 1: \x{fe} - /(\x{10a})\1/8i \x{10a}\x{10a} 0: \x{10a}\x{10a} |