| 1 |
|
/-- This set of tests is not Perl-compatible. It checks on special features |
| 2 |
|
of PCRE's API, error diagnostics, and the compiled code of some patterns. |
| 3 |
|
It also checks the non-Perl syntax the PCRE supports (Python, .NET, |
| 4 |
|
Oniguruma). Finally, there are some tests where PCRE and Perl differ, |
| 5 |
|
either because PCRE can't be compatible, or there is potential Perl |
| 6 |
|
bug. --/ |
| 7 |
|
|
| 8 |
|
/-- Originally, the Perl 5.10 things were in here too, but now I have separated |
| 9 |
|
many (most?) of them out into test 11. However, there may still be some |
| 10 |
|
that were overlooked. --/ |
| 11 |
|
|
| 12 |
/(a)b|/I |
/(a)b|/I |
| 13 |
|
|
| 14 |
/abc/I |
/abc/I |
| 344 |
*** Failers |
*** Failers |
| 345 |
a |
a |
| 346 |
|
|
| 347 |
/This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/I |
/This one is here because Perl behaves differently; see also the following/I |
| 348 |
|
|
| 349 |
/^(a\1?){4}$/I |
/^(a\1?){4}$/I |
| 350 |
|
aaaa |
| 351 |
aaaaaa |
aaaaaa |
| 352 |
|
|
| 353 |
|
/Perl does not fail these two for the final subjects. Neither did PCRE until/ |
| 354 |
|
/release 8.01. The problem is in backtracking into a subpattern that contains/ |
| 355 |
|
/a recursive reference to itself. PCRE has now made these into atomic patterns./ |
| 356 |
|
|
| 357 |
|
/^(xa|=?\1a){2}$/ |
| 358 |
|
xa=xaa |
| 359 |
|
** Failers |
| 360 |
|
xa=xaaa |
| 361 |
|
|
| 362 |
|
/^(xa|=?\1a)+$/ |
| 363 |
|
xa=xaa |
| 364 |
|
** Failers |
| 365 |
|
xa=xaaa |
| 366 |
|
|
| 367 |
/These are syntax tests from Perl 5.005/I |
/These are syntax tests from Perl 5.005/I |
| 368 |
|
|
| 1148 |
|
|
| 1149 |
/(a(?1)+b)/DZ |
/(a(?1)+b)/DZ |
| 1150 |
|
|
|
/^\W*(?:((.)\W*(?1)\W*\2|)|((.)\W*(?3)\W*\4|\W*.\W*))\W*$/Ii |
|
|
1221 |
|
|
Satan, oscillate my metallic sonatas! |
|
|
A man, a plan, a canal: Panama! |
|
|
Able was I ere I saw Elba. |
|
|
*** Failers |
|
|
The quick brown fox |
|
|
|
|
| 1151 |
/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I |
/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I |
| 1152 |
12 |
12 |
| 1153 |
(((2+2)*-3)-7) |
(((2+2)*-3)-7) |
| 1933 |
/(?=(?'abc'\w+))\k<abc>:/I |
/(?=(?'abc'\w+))\k<abc>:/I |
| 1934 |
abcd: |
abcd: |
| 1935 |
|
|
|
/(?'abc'\w+):\k<abc>{2}/ |
|
|
a:aaxyz |
|
|
ab:ababxyz |
|
|
** Failers |
|
|
a:axyz |
|
|
ab:abxyz |
|
|
|
|
| 1936 |
/(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J |
/(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J |
| 1937 |
adaa |
adaa |
| 1938 |
** Failers |
** Failers |
| 1945 |
** Failers |
** Failers |
| 1946 |
bddd |
bddd |
| 1947 |
|
|
|
/^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x |
|
|
abd |
|
|
ce |
|
|
|
|
| 1948 |
/(?(<bc))/ |
/(?(<bc))/ |
| 1949 |
|
|
| 1950 |
/(?(''))/ |
/(?(''))/ |
| 1962 |
/(?<1> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x |
/(?<1> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x |
| 1963 |
abcabc1Xabc2XabcXabcabc |
abcabc1Xabc2XabcXabcabc |
| 1964 |
|
|
|
/^(?(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 |
|
|
|
|
| 1965 |
/^(?(DEFINE) abc | xyz ) /x |
/^(?(DEFINE) abc | xyz ) /x |
| 1966 |
|
|
| 1967 |
/(?(DEFINE) abc) xyz/xI |
/(?(DEFINE) abc) xyz/xI |
| 2050 |
/(?1)X(?<abc>P)/I |
/(?1)X(?<abc>P)/I |
| 2051 |
abcPXP123 |
abcPXP123 |
| 2052 |
|
|
|
/(?(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 |
|
|
|
|
| 2053 |
/(?:a(?&abc)b)*(?<abc>x)/ |
/(?:a(?&abc)b)*(?<abc>x)/ |
| 2054 |
123axbaxbaxbx456 |
123axbaxbaxbx456 |
| 2055 |
123axbaxbaxb456 |
123axbaxbaxb456 |
| 2071 |
defabcabcxyz |
defabcabcxyz |
| 2072 |
DEFabcABCXYZ |
DEFabcABCXYZ |
| 2073 |
|
|
|
/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ |
|
|
ababababbbabZXXXX |
|
|
|
|
| 2074 |
/^(a)\g-2/ |
/^(a)\g-2/ |
| 2075 |
|
|
| 2076 |
/^(a)\g/ |
/^(a)\g/ |
| 2169 |
/^(?(+1)X|Y)(.)/BZ |
/^(?(+1)X|Y)(.)/BZ |
| 2170 |
Y! |
Y! |
| 2171 |
|
|
|
/(foo)\Kbar/ |
|
|
foobar |
|
|
|
|
|
/(foo)(\Kbar|baz)/ |
|
|
foobar |
|
|
foobaz |
|
|
|
|
|
/(foo\Kbar)baz/ |
|
|
foobarbaz |
|
|
|
|
| 2172 |
/(?<A>tom|bon)-\k{A}/ |
/(?<A>tom|bon)-\k{A}/ |
| 2173 |
tom-tom |
tom-tom |
| 2174 |
bon-bon |
bon-bon |
| 2175 |
** Failers |
** Failers |
| 2176 |
tom-bon |
tom-bon |
| 2177 |
|
|
|
/(?<A>tom|bon)-\g{A}/ |
|
|
tom-tom |
|
|
bon-bon |
|
|
|
|
| 2178 |
/\g{A/ |
/\g{A/ |
| 2179 |
|
|
| 2180 |
/(?|(abc)|(xyz))/BZ |
/(?|(abc)|(xyz))/BZ |
| 2189 |
xabcpqrx |
xabcpqrx |
| 2190 |
xxyzx |
xxyzx |
| 2191 |
|
|
|
/(?|(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 |
|
|
|
|
| 2192 |
/[\h]/BZ |
/[\h]/BZ |
| 2193 |
>\x09< |
>\x09< |
| 2194 |
|
|
| 2261 |
|
|
| 2262 |
/A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/BZ |
/A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/BZ |
| 2263 |
|
|
|
/^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 |
|
|
|
|
| 2264 |
/^a+(*FAIL)/C |
/^a+(*FAIL)/C |
| 2265 |
aaaaaa |
aaaaaa |
| 2266 |
|
|
| 2466 |
|
|
| 2467 |
/[[:a\dz:]]/ |
/[[:a\dz:]]/ |
| 2468 |
|
|
|
/^(?<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 |
|
|
|
|
| 2469 |
/(^(a|b\g<-1'c))/ |
/(^(a|b\g<-1'c))/ |
| 2470 |
|
|
|
/(^(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 |
|
|
|
|
| 2471 |
/^(?+1)(?<a>x|y){0}z/ |
/^(?+1)(?<a>x|y){0}z/ |
| 2472 |
xzxx |
xzxx |
| 2473 |
yzyy |
yzyy |
| 2574 |
/^"((?(?=[a])[^"])|b)*"$/ |
/^"((?(?=[a])[^"])|b)*"$/ |
| 2575 |
"ab" |
"ab" |
| 2576 |
|
|
|
/^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/ |
|
|
XYabcdY |
|
|
|
|
| 2577 |
/^X(?5)(a)(?|(b)|(q))(c)(d)Y/ |
/^X(?5)(a)(?|(b)|(q))(c)(d)Y/ |
| 2578 |
XYabcdY |
XYabcdY |
| 2579 |
|
|
| 2580 |
/^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/ |
/^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/ |
| 2581 |
XYabcdY |
XYabcdY |
| 2582 |
|
|
|
/^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 |
|
|
|
|
| 2583 |
/Xa{2,4}b/ |
/Xa{2,4}b/ |
| 2584 |
X\P |
X\P |
| 2585 |
Xa\P |
Xa\P |
| 2764 |
+++ab\P |
+++ab\P |
| 2765 |
+++ab\P\P |
+++ab\P\P |
| 2766 |
|
|
| 2767 |
/ End of testinput2 / |
/(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ |
| 2768 |
|
|
| 2769 |
|
/(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ |
| 2770 |
|
|
| 2771 |
|
/(ab)(x(y)z(cd(*ACCEPT)))pq/BZ |
| 2772 |
|
|
| 2773 |
|
/abc\K/+ |
| 2774 |
|
abcdef |
| 2775 |
|
abcdef\N\N |
| 2776 |
|
xyzabcdef\N\N |
| 2777 |
|
** Failers |
| 2778 |
|
abcdef\N |
| 2779 |
|
xyzabcdef\N |
| 2780 |
|
|
| 2781 |
|
/^(?:(?=abc)|abc\K)/+ |
| 2782 |
|
abcdef |
| 2783 |
|
abcdef\N\N |
| 2784 |
|
** Failers |
| 2785 |
|
abcdef\N |
| 2786 |
|
|
| 2787 |
|
/a?b?/+ |
| 2788 |
|
xyz |
| 2789 |
|
xyzabc |
| 2790 |
|
xyzabc\N |
| 2791 |
|
xyzabc\N\N |
| 2792 |
|
xyz\N\N |
| 2793 |
|
** Failers |
| 2794 |
|
xyz\N |
| 2795 |
|
|
| 2796 |
|
/^a?b?/+ |
| 2797 |
|
xyz |
| 2798 |
|
xyzabc |
| 2799 |
|
** Failers |
| 2800 |
|
xyzabc\N |
| 2801 |
|
xyzabc\N\N |
| 2802 |
|
xyz\N\N |
| 2803 |
|
xyz\N |
| 2804 |
|
|
| 2805 |
|
/^(?<name>a|b\g<name>c)/ |
| 2806 |
|
aaaa |
| 2807 |
|
bacxxx |
| 2808 |
|
bbaccxxx |
| 2809 |
|
bbbacccxx |
| 2810 |
|
|
| 2811 |
|
/^(?<name>a|b\g'name'c)/ |
| 2812 |
|
aaaa |
| 2813 |
|
bacxxx |
| 2814 |
|
bbaccxxx |
| 2815 |
|
bbbacccxx |
| 2816 |
|
|
| 2817 |
|
/^(a|b\g<1>c)/ |
| 2818 |
|
aaaa |
| 2819 |
|
bacxxx |
| 2820 |
|
bbaccxxx |
| 2821 |
|
bbbacccxx |
| 2822 |
|
|
| 2823 |
|
/^(a|b\g'1'c)/ |
| 2824 |
|
aaaa |
| 2825 |
|
bacxxx |
| 2826 |
|
bbaccxxx |
| 2827 |
|
bbbacccxx |
| 2828 |
|
|
| 2829 |
|
/^(a|b\g'-1'c)/ |
| 2830 |
|
aaaa |
| 2831 |
|
bacxxx |
| 2832 |
|
bbaccxxx |
| 2833 |
|
bbbacccxx |
| 2834 |
|
|
| 2835 |
|
/(^(a|b\g<-1>c))/ |
| 2836 |
|
aaaa |
| 2837 |
|
bacxxx |
| 2838 |
|
bbaccxxx |
| 2839 |
|
bbbacccxx |
| 2840 |
|
|
| 2841 |
|
/(?-i:\g<name>)(?i:(?<name>a))/ |
| 2842 |
|
XaaX |
| 2843 |
|
XAAX |
| 2844 |
|
|
| 2845 |
|
/(?i:\g<name>)(?-i:(?<name>a))/ |
| 2846 |
|
XaaX |
| 2847 |
|
** Failers |
| 2848 |
|
XAAX |
| 2849 |
|
|
| 2850 |
|
/(?-i:\g<+1>)(?i:(a))/ |
| 2851 |
|
XaaX |
| 2852 |
|
XAAX |
| 2853 |
|
|
| 2854 |
|
/(?=(?<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>\})\}))\{/ |
| 2855 |
|
|
| 2856 |
|
/(?<n>a|b|c)\g<n>*/ |
| 2857 |
|
abc |
| 2858 |
|
accccbbb |
| 2859 |
|
|
| 2860 |
|
/^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/ |
| 2861 |
|
XYabcdY |
| 2862 |
|
|
| 2863 |
|
/(?<=b(?1)|zzz)(a)/ |
| 2864 |
|
xbaax |
| 2865 |
|
xzzzax |
| 2866 |
|
|
| 2867 |
|
/(a)(?<=b\1)/ |
| 2868 |
|
|
| 2869 |
|
/(a)(?<=b+(?1))/ |
| 2870 |
|
|
| 2871 |
|
/(a+)(?<=b(?1))/ |
| 2872 |
|
|
| 2873 |
|
/(a(?<=b(?1)))/ |
| 2874 |
|
|
| 2875 |
|
/(?<=b(?1))xyz/ |
| 2876 |
|
|
| 2877 |
|
/(?<=b(?1))xyz(b+)pqrstuvew/ |
| 2878 |
|
|
| 2879 |
|
/(a|bc)\1/SI |
| 2880 |
|
|
| 2881 |
|
/(a|bc)\1{2,3}/SI |
| 2882 |
|
|
| 2883 |
|
/(a|bc)(?1)/SI |
| 2884 |
|
|
| 2885 |
|
/(a|b\1)(a|b\1)/SI |
| 2886 |
|
|
| 2887 |
|
/(a|b\1){2}/SI |
| 2888 |
|
|
| 2889 |
|
/(a|bbbb\1)(a|bbbb\1)/SI |
| 2890 |
|
|
| 2891 |
|
/(a|bbbb\1){2}/SI |
| 2892 |
|
|
| 2893 |
|
/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/SI |
| 2894 |
|
|
| 2895 |
|
/ (?: [\040\t] | \( |
| 2896 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2897 |
|
\) )* # optional leading comment |
| 2898 |
|
(?: (?: |
| 2899 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 2900 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 2901 |
|
| |
| 2902 |
|
" (?: # opening quote... |
| 2903 |
|
[^\\\x80-\xff\n\015"] # Anything except backslash and quote |
| 2904 |
|
| # or |
| 2905 |
|
\\ [^\x80-\xff] # Escaped something (something != CR) |
| 2906 |
|
)* " # closing quote |
| 2907 |
|
) # initial word |
| 2908 |
|
(?: (?: [\040\t] | \( |
| 2909 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2910 |
|
\) )* \. (?: [\040\t] | \( |
| 2911 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2912 |
|
\) )* (?: |
| 2913 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 2914 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 2915 |
|
| |
| 2916 |
|
" (?: # opening quote... |
| 2917 |
|
[^\\\x80-\xff\n\015"] # Anything except backslash and quote |
| 2918 |
|
| # or |
| 2919 |
|
\\ [^\x80-\xff] # Escaped something (something != CR) |
| 2920 |
|
)* " # closing quote |
| 2921 |
|
) )* # further okay, if led by a period |
| 2922 |
|
(?: [\040\t] | \( |
| 2923 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2924 |
|
\) )* @ (?: [\040\t] | \( |
| 2925 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2926 |
|
\) )* (?: |
| 2927 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 2928 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 2929 |
|
| \[ # [ |
| 2930 |
|
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff |
| 2931 |
|
\] # ] |
| 2932 |
|
) # initial subdomain |
| 2933 |
|
(?: # |
| 2934 |
|
(?: [\040\t] | \( |
| 2935 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2936 |
|
\) )* \. # if led by a period... |
| 2937 |
|
(?: [\040\t] | \( |
| 2938 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2939 |
|
\) )* (?: |
| 2940 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 2941 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 2942 |
|
| \[ # [ |
| 2943 |
|
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff |
| 2944 |
|
\] # ] |
| 2945 |
|
) # ...further okay |
| 2946 |
|
)* |
| 2947 |
|
# address |
| 2948 |
|
| # or |
| 2949 |
|
(?: |
| 2950 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 2951 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 2952 |
|
| |
| 2953 |
|
" (?: # opening quote... |
| 2954 |
|
[^\\\x80-\xff\n\015"] # Anything except backslash and quote |
| 2955 |
|
| # or |
| 2956 |
|
\\ [^\x80-\xff] # Escaped something (something != CR) |
| 2957 |
|
)* " # closing quote |
| 2958 |
|
) # one word, optionally followed by.... |
| 2959 |
|
(?: |
| 2960 |
|
[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... |
| 2961 |
|
\( |
| 2962 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2963 |
|
\) | # comments, or... |
| 2964 |
|
|
| 2965 |
|
" (?: # opening quote... |
| 2966 |
|
[^\\\x80-\xff\n\015"] # Anything except backslash and quote |
| 2967 |
|
| # or |
| 2968 |
|
\\ [^\x80-\xff] # Escaped something (something != CR) |
| 2969 |
|
)* " # closing quote |
| 2970 |
|
# quoted strings |
| 2971 |
|
)* |
| 2972 |
|
< (?: [\040\t] | \( |
| 2973 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2974 |
|
\) )* # leading < |
| 2975 |
|
(?: @ (?: [\040\t] | \( |
| 2976 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2977 |
|
\) )* (?: |
| 2978 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 2979 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 2980 |
|
| \[ # [ |
| 2981 |
|
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff |
| 2982 |
|
\] # ] |
| 2983 |
|
) # initial subdomain |
| 2984 |
|
(?: # |
| 2985 |
|
(?: [\040\t] | \( |
| 2986 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2987 |
|
\) )* \. # if led by a period... |
| 2988 |
|
(?: [\040\t] | \( |
| 2989 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 2990 |
|
\) )* (?: |
| 2991 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 2992 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 2993 |
|
| \[ # [ |
| 2994 |
|
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff |
| 2995 |
|
\] # ] |
| 2996 |
|
) # ...further okay |
| 2997 |
|
)* |
| 2998 |
|
|
| 2999 |
|
(?: (?: [\040\t] | \( |
| 3000 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3001 |
|
\) )* , (?: [\040\t] | \( |
| 3002 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3003 |
|
\) )* @ (?: [\040\t] | \( |
| 3004 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3005 |
|
\) )* (?: |
| 3006 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 3007 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 3008 |
|
| \[ # [ |
| 3009 |
|
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff |
| 3010 |
|
\] # ] |
| 3011 |
|
) # initial subdomain |
| 3012 |
|
(?: # |
| 3013 |
|
(?: [\040\t] | \( |
| 3014 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3015 |
|
\) )* \. # if led by a period... |
| 3016 |
|
(?: [\040\t] | \( |
| 3017 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3018 |
|
\) )* (?: |
| 3019 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 3020 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 3021 |
|
| \[ # [ |
| 3022 |
|
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff |
| 3023 |
|
\] # ] |
| 3024 |
|
) # ...further okay |
| 3025 |
|
)* |
| 3026 |
|
)* # further okay, if led by comma |
| 3027 |
|
: # closing colon |
| 3028 |
|
(?: [\040\t] | \( |
| 3029 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3030 |
|
\) )* )? # optional route |
| 3031 |
|
(?: |
| 3032 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 3033 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 3034 |
|
| |
| 3035 |
|
" (?: # opening quote... |
| 3036 |
|
[^\\\x80-\xff\n\015"] # Anything except backslash and quote |
| 3037 |
|
| # or |
| 3038 |
|
\\ [^\x80-\xff] # Escaped something (something != CR) |
| 3039 |
|
)* " # closing quote |
| 3040 |
|
) # initial word |
| 3041 |
|
(?: (?: [\040\t] | \( |
| 3042 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3043 |
|
\) )* \. (?: [\040\t] | \( |
| 3044 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3045 |
|
\) )* (?: |
| 3046 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 3047 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 3048 |
|
| |
| 3049 |
|
" (?: # opening quote... |
| 3050 |
|
[^\\\x80-\xff\n\015"] # Anything except backslash and quote |
| 3051 |
|
| # or |
| 3052 |
|
\\ [^\x80-\xff] # Escaped something (something != CR) |
| 3053 |
|
)* " # closing quote |
| 3054 |
|
) )* # further okay, if led by a period |
| 3055 |
|
(?: [\040\t] | \( |
| 3056 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3057 |
|
\) )* @ (?: [\040\t] | \( |
| 3058 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3059 |
|
\) )* (?: |
| 3060 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 3061 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 3062 |
|
| \[ # [ |
| 3063 |
|
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff |
| 3064 |
|
\] # ] |
| 3065 |
|
) # initial subdomain |
| 3066 |
|
(?: # |
| 3067 |
|
(?: [\040\t] | \( |
| 3068 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3069 |
|
\) )* \. # if led by a period... |
| 3070 |
|
(?: [\040\t] | \( |
| 3071 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3072 |
|
\) )* (?: |
| 3073 |
|
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... |
| 3074 |
|
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom |
| 3075 |
|
| \[ # [ |
| 3076 |
|
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff |
| 3077 |
|
\] # ] |
| 3078 |
|
) # ...further okay |
| 3079 |
|
)* |
| 3080 |
|
# address spec |
| 3081 |
|
(?: [\040\t] | \( |
| 3082 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3083 |
|
\) )* > # trailing > |
| 3084 |
|
# name and address |
| 3085 |
|
) (?: [\040\t] | \( |
| 3086 |
|
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* |
| 3087 |
|
\) )* # optional trailing comment |
| 3088 |
|
/xSI |
| 3089 |
|
|
| 3090 |
|
/<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/isIS |
| 3091 |
|
|
| 3092 |
|
"(?>.*/)foo"SI |
| 3093 |
|
|
| 3094 |
|
/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI |
| 3095 |
|
|
| 3096 |
|
/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI |
| 3097 |
|
|
| 3098 |
|
/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI |
| 3099 |
|
|
| 3100 |
|
/<a[\s]+href[\s]*=[\s]* # find <a href= |
| 3101 |
|
([\"\'])? # find single or double quote |
| 3102 |
|
(?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching |
| 3103 |
|
# quote, otherwise match up to next space |
| 3104 |
|
/isxSI |
| 3105 |
|
|
| 3106 |
|
/^(?!:) # colon disallowed at start |
| 3107 |
|
(?: # start of item |
| 3108 |
|
(?: [0-9a-f]{1,4} | # 1-4 hex digits or |
| 3109 |
|
(?(1)0 | () ) ) # if null previously matched, fail; else null |
| 3110 |
|
: # followed by colon |
| 3111 |
|
){1,7} # end item; 1-7 of them required |
| 3112 |
|
[0-9a-f]{1,4} $ # final hex number at end of string |
| 3113 |
|
(?(1)|.) # check that there was an empty component |
| 3114 |
|
/xiIS |
| 3115 |
|
|
| 3116 |
|
/(?|(?<a>A)|(?<a>B))/I |
| 3117 |
|
AB\Ca |
| 3118 |
|
BA\Ca |
| 3119 |
|
|
| 3120 |
|
/(?|(?<a>A)|(?<b>B))/ |
| 3121 |
|
|
| 3122 |
|
/(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) | |
| 3123 |
|
b(?<quote> (?<apostrophe>')|(?<realquote>")) ) |
| 3124 |
|
(?('quote')[a-z]+|[0-9]+)/JIx |
| 3125 |
|
a"aaaaa |
| 3126 |
|
b"aaaaa |
| 3127 |
|
** Failers |
| 3128 |
|
b"11111 |
| 3129 |
|
a"11111 |
| 3130 |
|
|
| 3131 |
|
/^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx |
| 3132 |
|
abcdX |
| 3133 |
|
eX |
| 3134 |
|
** Failers |
| 3135 |
|
abcdY |
| 3136 |
|
ey |
| 3137 |
|
|
| 3138 |
|
/(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/JDZx |
| 3139 |
|
abcdd |
| 3140 |
|
** Failers |
| 3141 |
|
abcdde |
| 3142 |
|
|
| 3143 |
|
/abcd*/ |
| 3144 |
|
xxxxabcd\P |
| 3145 |
|
xxxxabcd\P\P |
| 3146 |
|
|
| 3147 |
|
/abcd*/i |
| 3148 |
|
xxxxabcd\P |
| 3149 |
|
xxxxabcd\P\P |
| 3150 |
|
XXXXABCD\P |
| 3151 |
|
XXXXABCD\P\P |
| 3152 |
|
|
| 3153 |
|
/abc\d*/ |
| 3154 |
|
xxxxabc1\P |
| 3155 |
|
xxxxabc1\P\P |
| 3156 |
|
|
| 3157 |
|
/(a)bc\1*/ |
| 3158 |
|
xxxxabca\P |
| 3159 |
|
xxxxabca\P\P |
| 3160 |
|
|
| 3161 |
|
/abc[de]*/ |
| 3162 |
|
xxxxabcde\P |
| 3163 |
|
xxxxabcde\P\P |
| 3164 |
|
|
| 3165 |
|
/-- This is not in the Perl 5.10 test because Perl seems currently to be broken |
| 3166 |
|
and not behaving as specified in that it *does* bumpalong after hitting |
| 3167 |
|
(*COMMIT). --/ |
| 3168 |
|
|
| 3169 |
|
/(?1)(A(*COMMIT)|B)D/ |
| 3170 |
|
ABD |
| 3171 |
|
XABD |
| 3172 |
|
BAD |
| 3173 |
|
ABXABD |
| 3174 |
|
** Failers |
| 3175 |
|
ABX |
| 3176 |
|
BAXBAD |
| 3177 |
|
|
| 3178 |
|
/(\3)(\1)(a)/<JS> |
| 3179 |
|
cat |
| 3180 |
|
|
| 3181 |
|
/(\3)(\1)(a)/SI<JS> |
| 3182 |
|
cat |
| 3183 |
|
|
| 3184 |
|
/(\3)(\1)(a)/SI |
| 3185 |
|
cat |
| 3186 |
|
|
| 3187 |
|
/i(?(DEFINE)(?<s>a))/SI |
| 3188 |
|
i |
| 3189 |
|
|
| 3190 |
|
/()i(?(1)a)/SI |
| 3191 |
|
ia |
| 3192 |
|
|
| 3193 |
|
/(?i)a(?-i)b|c/BZ |
| 3194 |
|
XabX |
| 3195 |
|
XAbX |
| 3196 |
|
CcC |
| 3197 |
|
** Failers |
| 3198 |
|
XABX |
| 3199 |
|
|
| 3200 |
|
/(?i)a(?s)b|c/BZ |
| 3201 |
|
|
| 3202 |
|
/(?i)a(?s-i)b|c/BZ |
| 3203 |
|
|
| 3204 |
|
/^(ab(c\1)d|x){2}$/BZ |
| 3205 |
|
xabcxd |
| 3206 |
|
|
| 3207 |
|
/-- End of testinput2 --/ |