/[pcre]/code/trunk/testdata/testinput2
ViewVC logotype

Diff of /code/trunk/testdata/testinput2

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 247 by ph10, Mon Sep 17 09:38:32 2007 UTC revision 1302 by ph10, Wed Mar 27 11:13:36 2013 UTC
# Line 1  Line 1 
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 a possible Perl
6        bug.
7    
8        NOTE: This is a non-UTF set of tests. When UTF support is needed, use
9        test 5, and if Unicode Property Support is needed, use test 7. --/
10    
11  /(a)b|/I  /(a)b|/I
12    
13  /abc/I  /abc/I
# Line 40  Line 50 
50    
51  /(?X)[\B]/  /(?X)[\B]/
52    
53    /(?X)[\R]/
54    
55    /(?X)[\X]/
56    
57    /[\B]/BZ
58    
59    /[\R]/BZ
60    
61    /[\X]/BZ
62    
63  /[z-a]/  /[z-a]/
64    
65  /^*/  /^*/
# Line 123  Line 143 
143      defabc      defabc
144      \Zdefabc      \Zdefabc
145    
 /abc/IP  
     abc  
     *** Failers  
   
 /^abc|def/IP  
     abcdef  
     abcdef\B  
   
 /.*((abc)$|(def))/IP  
     defabc  
     \Zdefabc  
   
 /the quick brown fox/IP  
     the quick brown fox  
     *** Failers  
     The Quick Brown Fox  
   
 /the quick brown fox/IPi  
     the quick brown fox  
     The Quick Brown Fox  
   
 /abc.def/IP  
     *** Failers  
     abc\ndef  
   
 /abc$/IP  
     abc  
     abc\n  
   
 /(abc)\2/IP  
   
 /(abc\1)/IP  
     abc  
   
146  /)/  /)/
147    
148  /a[]b/  /a[]b/
# Line 327  Line 313 
313      *** Failers      *** Failers
314      fooabar      fooabar
315    
316  /This one is here because Perl 5.005_02 doesn't fail it/I  /This one is here because Perl behaves differently; see also the following/I
   
 /^(a)?(?(1)a|b)+$/I  
     *** Failers  
     a  
   
 /This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/I  
317    
318  /^(a\1?){4}$/I  /^(a\1?){4}$/I
319        aaaa
320      aaaaaa      aaaaaa
321    
322    /Perl does not fail these two for the final subjects. Neither did PCRE until/
323    /release 8.01. The problem is in backtracking into a subpattern that contains/
324    /a recursive reference to itself. PCRE has now made these into atomic patterns./
325    
326    /^(xa|=?\1a){2}$/
327        xa=xaa
328        ** Failers
329        xa=xaaa
330    
331    /^(xa|=?\1a)+$/
332        xa=xaa
333        ** Failers
334        xa=xaaa
335    
336  /These are syntax tests from Perl 5.005/I  /These are syntax tests from Perl 5.005/I
337    
# Line 398  Line 393 
393    
394  /(?(1?)a|b)/  /(?(1?)a|b)/
395    
 /(?(1)a|b|c)/  
   
396  /[a[:xyz:/  /[a[:xyz:/
397    
398  /(?<=x+)y/  /(?<=x+)y/
# Line 408  Line 401 
401    
402  /abc/\  /abc/\
403    
 /abc/\P  
   
404  /abc/\i  /abc/\i
405    
406  /(a)bc(d)/I  /(a)bc(d)/I
# Line 457  Line 448 
448  /\Biss\B/I+  /\Biss\B/I+
449      Mississippi      Mississippi
450    
 /\Biss\B/I+P  
     Mississippi  
   
451  /iss/IG+  /iss/IG+
452      Mississippi      Mississippi
453    
# Line 568  Line 556 
556    
557  /ab\d+/I  /ab\d+/I
558    
559  /a(?(1)b)/I  /a(?(1)b)(.)/I
560    
561  /a(?(1)bag|big)/I  /a(?(1)bag|big)(.)/I
562    
563  /a(?(1)bag|big)*/I  /a(?(1)bag|big)*(.)/I
564    
565  /a(?(1)bag|big)+/I  /a(?(1)bag|big)+(.)/I
566    
567  /a(?(1)b..|b..)/I  /a(?(1)b..|b..)(.)/I
568    
569  /ab\d{0}e/I  /ab\d{0}e/I
570    
# Line 595  Line 583 
583      *** Failers      *** Failers
584      \Nabc      \Nabc
585    
 /a*(b+)(z)(z)/IP  
     aaaabbbbzzzz  
     aaaabbbbzzzz\O0  
     aaaabbbbzzzz\O1  
     aaaabbbbzzzz\O2  
     aaaabbbbzzzz\O3  
     aaaabbbbzzzz\O4  
     aaaabbbbzzzz\O5  
   
586  /^.?abcd/IS  /^.?abcd/IS
587    
588  /\(             # ( at start  /\(             # ( at start
# Line 977  Line 956 
956    
957  /()a/I  /()a/I
958    
959  /(?(1)ab|ac)/I  /(?(1)ab|ac)(.)/I
960    
961  /(?(1)abz|acz)/I  /(?(1)abz|acz)(.)/I
962    
963  /(?(1)abz)/I  /(?(1)abz)(.)/I
964    
965  /(?(1)abz)123/I  /(?(1)abz)(1)23/I
966    
967  /(a)+/I  /(a)+/I
968    
# Line 1027  Line 1006 
1006  /abc(?C)de(?C1)f/I  /abc(?C)de(?C1)f/I
1007      123abcdef      123abcdef
1008    
1009  /(?C1)\dabc(?C2)def/I  /(?C1)\dabc(?C2)def/IS
1010        1234abcdef
1011        *** Failers
1012        abcdef
1013    
1014    /(?C1)\dabc(?C2)def/ISS
1015      1234abcdef      1234abcdef
1016      *** Failers      *** Failers
1017      abcdef      abcdef
# Line 1124  Line 1108 
1108    
1109  /(a(?1)+b)/DZ  /(a(?1)+b)/DZ
1110    
 /^\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  
   
1111  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
1112      12      12
1113      (((2+2)*-3)-7)      (((2+2)*-3)-7)
# Line 1284  Line 1260 
1260    abcde    abcde
1261    abcdfe    abcdfe
1262    
1263  /a*b/ICDZ  /a*b/ICDZS
1264      ab
1265      aaaab
1266      aaaacb
1267    
1268    /a*b/ICDZSS
1269    ab    ab
1270    aaaab    aaaab
1271    aaaacb    aaaacb
# Line 1294  Line 1275 
1275    aaaab    aaaab
1276    aaaacb    aaaacb
1277    
1278  /(abc|def)x/ICDZ  /(abc|def)x/ICDZS
1279      abcx
1280      defx
1281      ** Failers
1282      abcdefzx
1283    
1284    /(abc|def)x/ICDZSS
1285    abcx    abcx
1286    defx    defx
1287      ** Failers
1288    abcdefzx    abcdefzx
1289    
1290  /(ab|cd){3,4}/IC  /(ab|cd){3,4}/IC
# Line 1304  Line 1292 
1292    abcdabcd    abcdabcd
1293    abcdcdcdcdcd    abcdcdcdcdcd
1294    
1295  /([ab]{,4}c|xy)/ICDZ  /([ab]{,4}c|xy)/ICDZS
1296        Note: that { does NOT introduce a quantifier
1297    
1298    /([ab]{,4}c|xy)/ICDZSS
1299      Note: that { does NOT introduce a quantifier      Note: that { does NOT introduce a quantifier
1300    
1301  /([ab]{1,4}c|xy){4,5}?123/ICDZ  /([ab]{1,4}c|xy){4,5}?123/ICDZ
# Line 1378  Line 1369 
1369      1X      1X
1370      123456\P      123456\P
1371    
1372  /abc/I>testsavedregex  /abc/IS>testsavedregex
1373  <testsavedregex  <testsavedregex
1374      abc      abc
1375      ** Failers      ** Failers
1376      bca      bca
1377    
1378  /abc/IF>testsavedregex  /abc/ISS>testsavedregex
1379    <testsavedregex
1380        abc
1381        ** Failers
1382        bca
1383    
1384    /abc/IFS>testsavedregex
1385    <testsavedregex
1386        abc
1387        ** Failers
1388        bca
1389    
1390    /abc/IFSS>testsavedregex
1391  <testsavedregex  <testsavedregex
1392      abc      abc
1393      ** Failers      ** Failers
# Line 1396  Line 1399 
1399      ** Failers      ** Failers
1400      def      def
1401    
1402    /(a|b)/ISS>testsavedregex
1403    <testsavedregex
1404        abc
1405        ** Failers
1406        def
1407    
1408  /(a|b)/ISF>testsavedregex  /(a|b)/ISF>testsavedregex
1409  <testsavedregex  <testsavedregex
1410      abc      abc
1411      ** Failers      ** Failers
1412      def      def
1413    
1414    /(a|b)/ISSF>testsavedregex
1415    <testsavedregex
1416        abc
1417        ** Failers
1418        def
1419    
1420  ~<(\w+)/?>(.)*</(\1)>~smgI  ~<(\w+)/?>(.)*</(\1)>~smgI
1421      <!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>      \J1024<!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>
1422    
1423  /^a/IF  /^a/IF
1424    
# Line 1421  Line 1436 
1436      ** Failers      ** Failers
1437      line one\nthis is a line\nbreak in the second line      line one\nthis is a line\nbreak in the second line
1438    
 /ab.cd/IP  
     ab-cd  
     ab=cd  
     ** Failers  
     ab\ncd  
   
 /ab.cd/IPs  
     ab-cd  
     ab=cd  
     ab\ncd  
   
1439  /(?i)(?-i)AbCd/I  /(?i)(?-i)AbCd/I
1440      AbCd      AbCd
1441      ** Failers      ** Failers
# Line 1482  Line 1486 
1486      (this)      (this)
1487      ((this))      ((this))
1488    
 /a(b)c/IPN  
     abc  
   
 /a(?P<name>b)c/IPN  
     abc  
   
 /\x{100}/I  
   
1489  /\x{0000ff}/I  /\x{0000ff}/I
1490    
1491  /^((?P<A>a1)|(?P<A>a2)b)/I  /^((?P<A>a1)|(?P<A>a2)b)/I
# Line 1567  a random value. /Ix Line 1563  a random value. /Ix
1563  /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I  /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1564      bXXaYYaY      bXXaYYaY
1565    
 /\777/I  
   
1566  /\s*,\s*/IS  /\s*,\s*/IS
1567      \x0b,\x0b      \x0b,\x0b
1568      \x0c,\x0d      \x0c,\x0d
# Line 1917  a random value. /Ix Line 1911  a random value. /Ix
1911  /(?=(?'abc'\w+))\k<abc>:/I  /(?=(?'abc'\w+))\k<abc>:/I
1912      abcd:      abcd:
1913    
 /(?'abc'\w+):\k<abc>{2}/  
     a:aaxyz  
     ab:ababxyz  
     ** Failers  
     a:axyz  
     ab:abxyz  
   
1914  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
1915      adaa      adaa
1916      ** Failers      ** Failers
# Line 1936  a random value. /Ix Line 1923  a random value. /Ix
1923      ** Failers      ** Failers
1924      bddd      bddd
1925    
 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x  
     abd  
     ce  
   
1926  /(?(<bc))/  /(?(<bc))/
1927    
1928  /(?(''))/  /(?(''))/
# Line 1957  a random value. /Ix Line 1940  a random value. /Ix
1940  /(?<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
1941      abcabc1Xabc2XabcXabcabc      abcabc1Xabc2XabcXabcabc
1942    
 /^(?(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  
   
1943  /^(?(DEFINE) abc | xyz ) /x  /^(?(DEFINE) abc | xyz ) /x
1944    
1945  /(?(DEFINE) abc) xyz/xI  /(?(DEFINE) abc) xyz/xI
1946    
 /(?(DEFINE) abc){3} xyz/x  
   
1947  /(a|)*\d/  /(a|)*\d/
1948    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1949    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
# Line 1990  a random value. /Ix Line 1961  a random value. /Ix
1961      a\rb\<anycrlf>      a\rb\<anycrlf>
1962    
1963  /^abc./mgx<any>  /^abc./mgx<any>
1964      abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK      abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
1965    
1966  /abc.$/mgx<any>  /abc.$/mgx<any>
1967      abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9      abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
1968    
1969  /a/<cr><any>  /a/<cr><any>
1970    
# Line 2055  a random value. /Ix Line 2026  a random value. /Ix
2026  /(?1)X(?<abc>P)/I  /(?1)X(?<abc>P)/I
2027      abcPXP123      abcPXP123
2028    
 /(?(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  
   
2029  /(?:a(?&abc)b)*(?<abc>x)/  /(?:a(?&abc)b)*(?<abc>x)/
2030      123axbaxbaxbx456      123axbaxbaxbx456
2031      123axbaxbaxb456      123axbaxbaxb456
# Line 2092  a random value. /Ix Line 2047  a random value. /Ix
2047     defabcabcxyz     defabcabcxyz
2048     DEFabcABCXYZ     DEFabcABCXYZ
2049    
 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/  
     ababababbbabZXXXX  
   
2050  /^(a)\g-2/  /^(a)\g-2/
2051    
2052  /^(a)\g/  /^(a)\g/
# Line 2149  a random value. /Ix Line 2101  a random value. /Ix
2101      abc\r\n\r\n      abc\r\n\r\n
2102    
2103  /abc.$/mgx<anycrlf>  /abc.$/mgx<anycrlf>
2104      abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9      abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
2105    
2106  /^X/m  /^X/m
2107      XABC      XABC
# Line 2190  a random value. /Ix Line 2142  a random value. /Ix
2142    
2143  /((?(-2)a))/BZ  /((?(-2)a))/BZ
2144    
2145  /^(?(+1)X|Y)/BZ  /^(?(+1)X|Y)(.)/BZ
2146      Y      Y!
   
 /(foo)\Kbar/  
     foobar  
   
 /(foo)(\Kbar|baz)/  
     foobar  
     foobaz  
   
 /(foo\Kbar)baz/  
     foobarbaz  
2147    
2148  /(?<A>tom|bon)-\k{A}/  /(?<A>tom|bon)-\k{A}/
2149      tom-tom      tom-tom
# Line 2209  a random value. /Ix Line 2151  a random value. /Ix
2151      ** Failers      ** Failers
2152      tom-bon      tom-bon
2153    
 /(?<A>tom|bon)-\g{A}/  
     tom-tom  
     bon-bon  
   
2154  /\g{A/  /\g{A/
2155    
2156  /(?|(abc)|(xyz))/BZ  /(?|(abc)|(xyz))/BZ
# Line 2227  a random value. /Ix Line 2165  a random value. /Ix
2165      xabcpqrx      xabcpqrx
2166      xxyzx      xxyzx
2167    
 /(?|(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<  
   
 /[\h]+/BZ  
     >\x09\x20\xa0<  
   
 /[\v]/BZ  
   
 /[\H]/BZ  
   
 /[^\h]/BZ  
   
 /[\V]/BZ  
   
 /[\x0a\V]/BZ  
   
2168  /\H++X/BZ  /\H++X/BZ
2169      ** Failers      ** Failers
2170      XXXX      XXXX
# Line 2327  a random value. /Ix Line 2205  a random value. /Ix
2205  /\V+\v\V+\w/BZ  /\V+\v\V+\w/BZ
2206    
2207  /\( (?: [^()]* | (?R) )* \)/x  /\( (?: [^()]* | (?R) )* \)/x
2208  (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(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0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)
2209    
2210  /[\E]AAA/  /[\E]AAA/
2211    
# Line 2343  a random value. /Ix Line 2221  a random value. /Ix
2221    
2222  /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
2223    
 /^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  
   
2224  /^a+(*FAIL)/C  /^a+(*FAIL)/C
2225      aaaaaa      aaaaaa
2226    
# Line 2404  a random value. /Ix Line 2239  a random value. /Ix
2239  /a+b?(*THEN)c+(*FAIL)/C  /a+b?(*THEN)c+(*FAIL)/C
2240      aaabccc      aaabccc
2241    
 /a(*PRUNE:XXX)b/  
   
2242  /a(*MARK)b/  /a(*MARK)b/
2243    
2244  /(?i:A{1,}\6666666666)/  /(?i:A{1,}\6666666666)/
2245    
2246  /\g6666666666/  /\g6666666666/
2247    
2248  /[\g6666666666]/  /[\g6666666666]/BZ
2249    
2250  /(?1)\c[/  /(?1)\c[/
2251    
# Line 2463  a random value. /Ix Line 2296  a random value. /Ix
2296      a\nb      a\nb
2297      a\r\nb      a\r\nb
2298      a\x85b      a\x85b
2299    
2300    /(*ANY).*/g
2301        abc\r\ndef
2302    
2303    /(*ANYCRLF).*/g
2304        abc\r\ndef
2305    
2306    /(*CRLF).*/g
2307        abc\r\ndef
2308    
2309  /a\Rb/I<bsr_anycrlf>  /a\Rb/I<bsr_anycrlf>
2310      a\rb      a\rb
# Line 2535  a random value. /Ix Line 2377  a random value. /Ix
2377    
2378  /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I  /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
2379    
2380  / End of testinput2 /  /(?<a>)(?&)/
2381    
2382    /(?<abc>)(?&a)/
2383    
2384    /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
2385    
2386    /(?+-a)/
2387    
2388    /(?-+a)/
2389    
2390    /(?(-1))/
2391    
2392    /(?(+10))/
2393    
2394    /(?(10))/
2395    
2396    /(?(+2))()()/
2397    
2398    /(?(2))()()/
2399    
2400    /\k''/
2401    
2402    /\k<>/
2403    
2404    /\k{}/
2405    
2406    /\k/
2407    
2408    /\kabc/
2409    
2410    /(?P=)/
2411    
2412    /(?P>)/
2413    
2414    /(?!\w)(?R)/
2415    
2416    /(?=\w)(?R)/
2417    
2418    /(?<!\w)(?R)/
2419    
2420    /(?<=\w)(?R)/
2421    
2422    /[[:foo:]]/
2423    
2424    /[[:1234:]]/
2425    
2426    /[[:f\oo:]]/
2427    
2428    /[[: :]]/
2429    
2430    /[[:...:]]/
2431    
2432    /[[:l\ower:]]/
2433    
2434    /[[:abc\:]]/
2435    
2436    /[abc[:x\]pqr:]]/
2437    
2438    /[[:a\dz:]]/
2439    
2440    /(^(a|b\g<-1'c))/
2441    
2442    /^(?+1)(?<a>x|y){0}z/
2443        xzxx
2444        yzyy
2445        ** Failers
2446        xxz
2447    
2448    /(\3)(\1)(a)/
2449        cat
2450    
2451    /(\3)(\1)(a)/<JS>
2452        cat
2453    
2454    /TA]/
2455        The ACTA] comes
2456    
2457    /TA]/<JS>
2458        The ACTA] comes
2459    
2460    /(?2)[]a()b](abc)/
2461        abcbabc
2462    
2463    /(?2)[^]a()b](abc)/
2464        abcbabc
2465    
2466    /(?1)[]a()b](abc)/
2467        abcbabc
2468        ** Failers
2469        abcXabc
2470    
2471    /(?1)[^]a()b](abc)/
2472        abcXabc
2473        ** Failers
2474        abcbabc
2475    
2476    /(?2)[]a()b](abc)(xyz)/
2477        xyzbabcxyz
2478    
2479    /(?&N)[]a(?<N>)](?<M>abc)/
2480       abc<abc
2481    
2482    /(?&N)[]a(?<N>)](abc)/
2483       abc<abc
2484    
2485    /a[]b/
2486    
2487    /a[^]b/
2488    
2489    /a[]b/<JS>
2490        ** Failers
2491        ab
2492    
2493    /a[]+b/<JS>
2494        ** Failers
2495        ab
2496    
2497    /a[]*+b/<JS>
2498        ** Failers
2499        ab
2500    
2501    /a[^]b/<JS>
2502        aXb
2503        a\nb
2504        ** Failers
2505        ab
2506    
2507    /a[^]+b/<JS>
2508        aXb
2509        a\nX\nXb
2510        ** Failers
2511        ab
2512    
2513    /a(?!)+b/
2514    
2515    /a(*FAIL)+b/
2516    
2517    /(abc|pqr|123){0}[xyz]/SI
2518    
2519    /(?(?=.*b)b|^)/CI
2520       adc
2521       abc
2522    
2523    /(?(?=b).*b|^d)/I
2524    
2525    /(?(?=.*b).*b|^d)/I
2526    
2527    /xyz/C
2528      xyz
2529      abcxyz
2530      abcxyz\Y
2531      ** Failers
2532      abc
2533      abc\Y
2534      abcxypqr
2535      abcxypqr\Y
2536    
2537    /(*NO_START_OPT)xyz/C
2538      abcxyz
2539    
2540    /xyz/CY
2541      abcxyz
2542    
2543    /^"((?(?=[a])[^"])|b)*"$/C
2544        "ab"
2545    
2546    /^"((?(?=[a])[^"])|b)*"$/
2547        "ab"
2548    
2549    /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
2550        XYabcdY
2551    
2552    /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
2553        XYabcdY
2554    
2555    /Xa{2,4}b/
2556        X\P
2557        Xa\P
2558        Xaa\P
2559        Xaaa\P
2560        Xaaaa\P
2561    
2562    /Xa{2,4}?b/
2563        X\P
2564        Xa\P
2565        Xaa\P
2566        Xaaa\P
2567        Xaaaa\P
2568    
2569    /Xa{2,4}+b/
2570        X\P
2571        Xa\P
2572        Xaa\P
2573        Xaaa\P
2574        Xaaaa\P
2575    
2576    /X\d{2,4}b/
2577        X\P
2578        X3\P
2579        X33\P
2580        X333\P
2581        X3333\P
2582    
2583    /X\d{2,4}?b/
2584        X\P
2585        X3\P
2586        X33\P
2587        X333\P
2588        X3333\P
2589    
2590    /X\d{2,4}+b/
2591        X\P
2592        X3\P
2593        X33\P
2594        X333\P
2595        X3333\P
2596    
2597    /X\D{2,4}b/
2598        X\P
2599        Xa\P
2600        Xaa\P
2601        Xaaa\P
2602        Xaaaa\P
2603    
2604    /X\D{2,4}?b/
2605        X\P
2606        Xa\P
2607        Xaa\P
2608        Xaaa\P
2609        Xaaaa\P
2610    
2611    /X\D{2,4}+b/
2612        X\P
2613        Xa\P
2614        Xaa\P
2615        Xaaa\P
2616        Xaaaa\P
2617    
2618    /X[abc]{2,4}b/
2619        X\P
2620        Xa\P
2621        Xaa\P
2622        Xaaa\P
2623        Xaaaa\P
2624    
2625    /X[abc]{2,4}?b/
2626        X\P
2627        Xa\P
2628        Xaa\P
2629        Xaaa\P
2630        Xaaaa\P
2631    
2632    /X[abc]{2,4}+b/
2633        X\P
2634        Xa\P
2635        Xaa\P
2636        Xaaa\P
2637        Xaaaa\P
2638    
2639    /X[^a]{2,4}b/
2640        X\P
2641        Xz\P
2642        Xzz\P
2643        Xzzz\P
2644        Xzzzz\P
2645    
2646    /X[^a]{2,4}?b/
2647        X\P
2648        Xz\P
2649        Xzz\P
2650        Xzzz\P
2651        Xzzzz\P
2652    
2653    /X[^a]{2,4}+b/
2654        X\P
2655        Xz\P
2656        Xzz\P
2657        Xzzz\P
2658        Xzzzz\P
2659    
2660    /(Y)X\1{2,4}b/
2661        YX\P
2662        YXY\P
2663        YXYY\P
2664        YXYYY\P
2665        YXYYYY\P
2666    
2667    /(Y)X\1{2,4}?b/
2668        YX\P
2669        YXY\P
2670        YXYY\P
2671        YXYYY\P
2672        YXYYYY\P
2673    
2674    /(Y)X\1{2,4}+b/
2675        YX\P
2676        YXY\P
2677        YXYY\P
2678        YXYYY\P
2679        YXYYYY\P
2680    
2681    /\++\KZ|\d+X|9+Y/
2682        ++++123999\P
2683        ++++123999Y\P
2684        ++++Z1234\P
2685    
2686    /Z(*F)/
2687        Z\P
2688        ZA\P
2689    
2690    /Z(?!)/
2691        Z\P
2692        ZA\P
2693    
2694    /dog(sbody)?/
2695        dogs\P
2696        dogs\P\P
2697    
2698    /dog(sbody)??/
2699        dogs\P
2700        dogs\P\P
2701    
2702    /dog|dogsbody/
2703        dogs\P
2704        dogs\P\P
2705    
2706    /dogsbody|dog/
2707        dogs\P
2708        dogs\P\P
2709    
2710    /\bthe cat\b/
2711        the cat\P
2712        the cat\P\P
2713    
2714    /abc/
2715       abc\P
2716       abc\P\P
2717    
2718    /abc\K123/
2719        xyzabc123pqr
2720        xyzabc12\P
2721        xyzabc12\P\P
2722    
2723    /(?<=abc)123/
2724        xyzabc123pqr
2725        xyzabc12\P
2726        xyzabc12\P\P
2727    
2728    /\babc\b/
2729        +++abc+++
2730        +++ab\P
2731        +++ab\P\P
2732    
2733    /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
2734    
2735    /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
2736    
2737    /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
2738    
2739    /abc\K/+
2740        abcdef
2741        abcdef\N\N
2742        xyzabcdef\N\N
2743        ** Failers
2744        abcdef\N
2745        xyzabcdef\N
2746    
2747    /^(?:(?=abc)|abc\K)/+
2748        abcdef
2749        abcdef\N\N
2750        ** Failers
2751        abcdef\N
2752    
2753    /a?b?/+
2754        xyz
2755        xyzabc
2756        xyzabc\N
2757        xyzabc\N\N
2758        xyz\N\N
2759        ** Failers
2760        xyz\N
2761    
2762    /^a?b?/+
2763        xyz
2764        xyzabc
2765        ** Failers
2766        xyzabc\N
2767        xyzabc\N\N
2768        xyz\N\N
2769        xyz\N
2770    
2771    /^(?<name>a|b\g<name>c)/
2772        aaaa
2773        bacxxx
2774        bbaccxxx
2775        bbbacccxx
2776    
2777    /^(?<name>a|b\g'name'c)/
2778        aaaa
2779        bacxxx
2780        bbaccxxx
2781        bbbacccxx
2782    
2783    /^(a|b\g<1>c)/
2784        aaaa
2785        bacxxx
2786        bbaccxxx
2787        bbbacccxx
2788    
2789    /^(a|b\g'1'c)/
2790        aaaa
2791        bacxxx
2792        bbaccxxx
2793        bbbacccxx
2794    
2795    /^(a|b\g'-1'c)/
2796        aaaa
2797        bacxxx
2798        bbaccxxx
2799        bbbacccxx
2800    
2801    /(^(a|b\g<-1>c))/
2802        aaaa
2803        bacxxx
2804        bbaccxxx
2805        bbbacccxx
2806    
2807    /(?-i:\g<name>)(?i:(?<name>a))/
2808        XaaX
2809        XAAX
2810    
2811    /(?i:\g<name>)(?-i:(?<name>a))/
2812        XaaX
2813        ** Failers
2814        XAAX
2815    
2816    /(?-i:\g<+1>)(?i:(a))/
2817        XaaX
2818        XAAX
2819    
2820    /(?=(?<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>\})\}))\{/
2821    
2822    /(?<n>a|b|c)\g<n>*/
2823       abc
2824       accccbbb
2825    
2826    /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
2827        XYabcdY
2828    
2829    /(?<=b(?1)|zzz)(a)/
2830        xbaax
2831        xzzzax
2832    
2833    /(a)(?<=b\1)/
2834    
2835    /(a)(?<=b+(?1))/
2836    
2837    /(a+)(?<=b(?1))/
2838    
2839    /(a(?<=b(?1)))/
2840    
2841    /(?<=b(?1))xyz/
2842    
2843    /(?<=b(?1))xyz(b+)pqrstuvew/
2844    
2845    /(a|bc)\1/SI
2846    
2847    /(a|bc)\1{2,3}/SI
2848    
2849    /(a|bc)(?1)/SI
2850    
2851    /(a|b\1)(a|b\1)/SI
2852    
2853    /(a|b\1){2}/SI
2854    
2855    /(a|bbbb\1)(a|bbbb\1)/SI
2856    
2857    /(a|bbbb\1){2}/SI
2858    
2859    /^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
2860    
2861    /<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
2862    
2863    "(?>.*/)foo"SI
2864    
2865    /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /xSI
2866    
2867    /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
2868    
2869    /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
2870    
2871    /<a[\s]+href[\s]*=[\s]*          # find <a href=
2872     ([\"\'])?                       # find single or double quote
2873     (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
2874                                     # quote, otherwise match up to next space
2875    /isxSI
2876    
2877    /^(?!:)                       # colon disallowed at start
2878      (?:                         # start of item
2879        (?: [0-9a-f]{1,4} |       # 1-4 hex digits or
2880        (?(1)0 | () ) )           # if null previously matched, fail; else null
2881        :                         # followed by colon
2882      ){1,7}                      # end item; 1-7 of them required
2883      [0-9a-f]{1,4} $             # final hex number at end of string
2884      (?(1)|.)                    # check that there was an empty component
2885      /xiIS
2886    
2887    /(?|(?<a>A)|(?<a>B))/I
2888        AB\Ca
2889        BA\Ca
2890    
2891    /(?|(?<a>A)|(?<b>B))/
2892    
2893    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
2894        b(?<quote> (?<apostrophe>')|(?<realquote>")) )
2895        (?('quote')[a-z]+|[0-9]+)/JIx
2896        a"aaaaa
2897        b"aaaaa
2898        ** Failers
2899        b"11111
2900        a"11111
2901    
2902    /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
2903        abcdX
2904        eX
2905        ** Failers
2906        abcdY
2907        ey
2908    
2909    /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/JDZx
2910        abcdd
2911        ** Failers
2912        abcdde
2913    
2914    /abcd*/
2915        xxxxabcd\P
2916        xxxxabcd\P\P
2917    
2918    /abcd*/i
2919        xxxxabcd\P
2920        xxxxabcd\P\P
2921        XXXXABCD\P
2922        XXXXABCD\P\P
2923    
2924    /abc\d*/
2925        xxxxabc1\P
2926        xxxxabc1\P\P
2927    
2928    /(a)bc\1*/
2929        xxxxabca\P
2930        xxxxabca\P\P
2931    
2932    /abc[de]*/
2933        xxxxabcde\P
2934        xxxxabcde\P\P
2935    
2936    /-- This is not in the Perl-compatible test because Perl seems currently to be
2937        broken and not behaving as specified in that it *does* bumpalong after
2938        hitting (*COMMIT). --/
2939    
2940    /(?1)(A(*COMMIT)|B)D/
2941        ABD
2942        XABD
2943        BAD
2944        ABXABD
2945        ** Failers
2946        ABX
2947        BAXBAD
2948    
2949    /(\3)(\1)(a)/<JS>
2950        cat
2951    
2952    /(\3)(\1)(a)/SI<JS>
2953        cat
2954    
2955    /(\3)(\1)(a)/SI
2956        cat
2957    
2958    /i(?(DEFINE)(?<s>a))/SI
2959        i
2960    
2961    /()i(?(1)a)/SI
2962        ia
2963    
2964    /(?i)a(?-i)b|c/BZ
2965        XabX
2966        XAbX
2967        CcC
2968        ** Failers
2969        XABX
2970    
2971    /(?i)a(?s)b|c/BZ
2972    
2973    /(?i)a(?s-i)b|c/BZ
2974    
2975    /^(ab(c\1)d|x){2}$/BZ
2976        xabcxd
2977    
2978    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
2979    
2980    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
2981    
2982    / -- This one is here because Perl gives the match as "b" rather than "ab". I
2983         believe this to be a Perl bug. --/
2984    
2985    /(?>a\Kb)z|(ab)/
2986        ab
2987    
2988    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
2989    
2990    /abc(*MARK:)pqr/
2991    
2992    /abc(*:)pqr/
2993    
2994    /abc(*FAIL:123)xyz/
2995    
2996    /--- This should, and does, fail. In Perl, it does not, which I think is a
2997         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
2998    
2999    /A(*COMMIT)B/+K
3000        ACABX
3001    
3002    /--- These should be different, but in Perl they are not, which I think
3003         is a bug in Perl. ---/
3004    
3005    /A(*THEN)B|A(*THEN)C/K
3006        AC
3007    
3008    /A(*PRUNE)B|A(*PRUNE)C/K
3009        AC
3010    
3011    /--- Mark names can be duplicated. Perl doesn't give a mark for this one,
3012    though PCRE does. ---/
3013    
3014    /^A(*:A)B|^X(*:A)Y/K
3015        ** Failers
3016        XAQQ
3017    
3018    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3019    optimizations defeat this. So does the PCRE optimization unless we disable it
3020    with \Y. ---/
3021    
3022    /(*COMMIT)ABC/
3023        ABCDEFG
3024        ** Failers
3025        DEFGABC\Y
3026    
3027    /^(ab (c+(*THEN)cd) | xyz)/x
3028        abcccd
3029    
3030    /^(ab (c+(*PRUNE)cd) | xyz)/x
3031        abcccd
3032    
3033    /^(ab (c+(*FAIL)cd) | xyz)/x
3034        abcccd
3035    
3036    /--- Perl gets some of these wrong ---/
3037    
3038    /(?>.(*ACCEPT))*?5/
3039        abcde
3040    
3041    /(.(*ACCEPT))*?5/
3042        abcde
3043    
3044    /(.(*ACCEPT))5/
3045        abcde
3046    
3047    /(.(*ACCEPT))*5/
3048        abcde
3049    
3050    /A\NB./BZ
3051        ACBD
3052        *** Failers
3053        A\nB
3054        ACB\n
3055    
3056    /A\NB./sBZ
3057        ACBD
3058        ACB\n
3059        *** Failers
3060        A\nB
3061    
3062    /A\NB/<crlf>
3063        A\nB
3064        A\rB
3065        ** Failers
3066        A\r\nB
3067    
3068    /\R+b/BZ
3069    
3070    /\R+\n/BZ
3071    
3072    /\R+\d/BZ
3073    
3074    /\d*\R/BZ
3075    
3076    /\s*\R/BZ
3077        \x20\x0a
3078        \x20\x0d
3079        \x20\x0d\x0a
3080    
3081    /\S*\R/BZ
3082        a\x0a
3083    
3084    /X\h*\R/BZ
3085        X\x20\x0a
3086    
3087    /X\H*\R/BZ
3088        X\x0d\x0a
3089    
3090    /X\H+\R/BZ
3091        X\x0d\x0a
3092    
3093    /X\H++\R/BZ
3094        X\x0d\x0a
3095    
3096    /(?<=abc)def/
3097        abc\P\P
3098    
3099    /abc$/
3100        abc
3101        abc\P
3102        abc\P\P
3103    
3104    /abc$/m
3105        abc
3106        abc\n
3107        abc\P\P
3108        abc\n\P\P
3109        abc\P
3110        abc\n\P
3111    
3112    /abc\z/
3113        abc
3114        abc\P
3115        abc\P\P
3116    
3117    /abc\Z/
3118        abc
3119        abc\P
3120        abc\P\P
3121    
3122    /abc\b/
3123        abc
3124        abc\P
3125        abc\P\P
3126    
3127    /abc\B/
3128        abc
3129        abc\P
3130        abc\P\P
3131    
3132    /.+/
3133        abc\>0
3134        abc\>1
3135        abc\>2
3136        abc\>3
3137        abc\>4
3138        abc\>-4
3139    
3140    /^\cģ/
3141    
3142    /(?P<abn>(?P=abn)xxx)/BZ
3143    
3144    /(a\1z)/BZ
3145    
3146    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
3147    
3148    /(?P<abn>(?P=axn)xxx)/BZ
3149    
3150    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
3151    
3152    /-- These tests are here because Perl gets the first one wrong. --/
3153    
3154    /(\R*)(.)/s
3155        \r\n
3156        \r\r\n\n\r
3157        \r\r\n\n\r\n
3158    
3159    /(\R)*(.)/s
3160        \r\n
3161        \r\r\n\n\r
3162        \r\r\n\n\r\n
3163    
3164    /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
3165        \r\n
3166        \r\r\n\n\r
3167        \r\r\n\n\r\n
3168    
3169    /-- --/
3170    
3171    /^abc$/BZ
3172    
3173    /^abc$/BZm
3174    
3175    /^(a)*+(\w)/S
3176        aaaaX
3177        ** Failers
3178        aaaa
3179    
3180    /^(?:a)*+(\w)/S
3181        aaaaX
3182        ** Failers
3183        aaaa
3184    
3185    /(a)++1234/SDZ
3186    
3187    /([abc])++1234/SI
3188    
3189    /(?<=(abc)+)X/
3190    
3191    /(^ab)/I
3192    
3193    /(^ab)++/I
3194    
3195    /(^ab|^)+/I
3196    
3197    /(^ab|^)++/I
3198    
3199    /(?:^ab)/I
3200    
3201    /(?:^ab)++/I
3202    
3203    /(?:^ab|^)+/I
3204    
3205    /(?:^ab|^)++/I
3206    
3207    /(.*ab)/I
3208    
3209    /(.*ab)++/I
3210    
3211    /(.*ab|.*)+/I
3212    
3213    /(.*ab|.*)++/I
3214    
3215    /(?:.*ab)/I
3216    
3217    /(?:.*ab)++/I
3218    
3219    /(?:.*ab|.*)+/I
3220    
3221    /(?:.*ab|.*)++/I
3222    
3223    /(?=a)[bcd]/I
3224    
3225    /((?=a))[bcd]/I
3226    
3227    /((?=a))+[bcd]/I
3228    
3229    /((?=a))++[bcd]/I
3230    
3231    /(?=a+)[bcd]/iI
3232    
3233    /(?=a+?)[bcd]/iI
3234    
3235    /(?=a++)[bcd]/iI
3236    
3237    /(?=a{3})[bcd]/iI
3238    
3239    /(abc)\1+/S
3240    
3241    /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
3242    
3243    /(?1)(?:(b(*ACCEPT))){0}/
3244        b
3245    
3246    /(?1)(?:(b(*ACCEPT))){0}c/
3247        bc
3248        ** Failers
3249        b
3250    
3251    /(?1)(?:((*ACCEPT))){0}c/
3252        c
3253        c\N
3254    
3255    /^.*?(?(?=a)a|b(*THEN)c)/
3256        ba
3257    
3258    /^.*?(?(?=a)a|bc)/
3259        ba
3260    
3261    /^.*?(?(?=a)a(*THEN)b|c)/
3262        ac
3263    
3264    /^.*?(?(?=a)a(*THEN)b)c/
3265        ac
3266    
3267    /^.*?(a(*THEN)b)c/
3268        aabc
3269    
3270    /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
3271        aabc
3272    
3273    /^.*?(a(*THEN)b|z)c/
3274        aabc
3275    
3276    /^.*?(z|a(*THEN)b)c/
3277        aabc
3278    
3279    /-- --/
3280    
3281    /-- These studied versions are here because they are not Perl-compatible; the
3282        studying means the mark is not seen. --/
3283    
3284    /(*MARK:A)(*SKIP:B)(C|X)/KS
3285        C
3286        D
3287    
3288    /(*:A)A+(*SKIP:A)(B|Z)/KS
3289        AAAC
3290    
3291    /-- --/
3292    
3293    "(?=a*(*ACCEPT)b)c"
3294        c
3295        c\N
3296    
3297    /(?1)c(?(DEFINE)((*ACCEPT)b))/
3298        c
3299        c\N
3300    
3301    /(?>(*ACCEPT)b)c/
3302        c
3303        c\N
3304    
3305    /(?:(?>(a)))+a%/++
3306        %aa%
3307    
3308    /(a)b|ac/++SS
3309        ac\O3
3310    
3311    /(a)(b)x|abc/++
3312         abc\O6
3313    
3314    /(a)bc|(a)(b)\2/
3315        \O3abc
3316        \O4abc
3317    
3318    /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI
3319    
3320    /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
3321    
3322    /(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
3323    
3324    /(abc)(?1)/SI
3325    
3326    /^(?>a)++/
3327        aa\M
3328        aaaaaaaaa\M
3329    
3330    /(a)(?1)++/
3331        aa\M
3332        aaaaaaaaa\M
3333    
3334    /(?:(foo)|(bar)|(baz))X/SS=
3335        bazfooX
3336        foobazbarX
3337        barfooX
3338        bazX
3339        foobarbazX
3340        bazfooX\O0
3341        bazfooX\O2
3342        bazfooX\O4
3343        bazfooX\O6
3344        bazfooX\O8
3345        bazfooX\O10
3346    
3347    /(?=abc){3}abc/BZ
3348    
3349    /(?=abc)+abc/BZ
3350    
3351    /(?=abc)++abc/BZ
3352    
3353    /(?=abc){0}xyz/BZ
3354    
3355    /(?=(a))?./BZ
3356    
3357    /(?=(a))??./BZ
3358    
3359    /^(?=(a)){0}b(?1)/BZ
3360    
3361    /(?(DEFINE)(a))?b(?1)/BZ
3362    
3363    /^(?=(?1))?[az]([abc])d/BZ
3364    
3365    /^(?!a){0}\w+/BZ
3366    
3367    /(?<=(abc))?xyz/BZ
3368    
3369    /[:a[:abc]b:]/BZ
3370    
3371    /((?2))((?1))/SS
3372        abc
3373    
3374    /((?(R2)a+|(?1)b))/SS
3375        aaaabcde
3376    
3377    /(?(R)a*(?1)|((?R))b)/SS
3378        aaaabcde
3379    
3380    /(a+|(?R)b)/
3381    
3382    /^(a(*:A)(d|e(*:B))z|aeq)/C
3383        adz
3384        aez
3385        aeqwerty
3386    
3387    /.(*F)/
3388        \P\Pabc
3389    
3390    /\btype\b\W*?\btext\b\W*?\bjavascript\b/IS
3391    
3392    /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS
3393    
3394    /a(*SKIP)c|b(*ACCEPT)|/+S!I
3395        a
3396    
3397    /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/SI
3398        ax
3399    
3400    'a*(*ACCEPT)b'+
3401        \N\N
3402        abc\N\N
3403        bbb\N\N
3404    
3405    /(*ACCEPT)a/+I
3406        bax
3407    
3408    /z(*ACCEPT)a/+I
3409        baxzbx
3410    
3411    /a(?:.)*?a/ims
3412        \Mabbbbbbbbbbbbbbbbbbbbba
3413    
3414    /a(?:.(*THEN))*?a/ims
3415        \Mabbbbbbbbbbbbbbbbbbbbba
3416    
3417    /a(?:.(*THEN:ABC))*?a/ims
3418        \Mabbbbbbbbbbbbbbbbbbbbba
3419    
3420    /^(?>a+)(?>(z+))\w/BZ
3421        aaaazzzzb
3422        ** Failers
3423        aazz
3424    
3425    /(.)(\1|a(?2))/
3426        bab
3427    
3428    /\1|(.)(?R)\1/
3429        cbbbc
3430    
3431    /(.)((?(1)c|a)|a(?2))/
3432        baa
3433    
3434    /(?P<abn>(?P=abn)xxx)/BZ
3435    
3436    /(a\1z)/BZ
3437    
3438    /^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
3439         \Maabbccddee
3440    
3441    /^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
3442         \Maabbccddee
3443    
3444    /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
3445         \Maabbccddee
3446    
3447    /^a\x41z/<JS>
3448        aAz
3449        *** Failers
3450        ax41z
3451    
3452    /^a[m\x41]z/<JS>
3453        aAz
3454    
3455    /^a\x1z/<JS>
3456        ax1z
3457    
3458    /^a\u0041z/<JS>
3459        aAz
3460        *** Failers
3461        au0041z
3462    
3463    /^a[m\u0041]z/<JS>
3464        aAz
3465    
3466    /^a\u041z/<JS>
3467        au041z
3468        *** Failers
3469        aAz
3470    
3471    /^a\U0041z/<JS>
3472        aU0041z
3473        *** Failers
3474        aAz
3475    
3476    /(?(?=c)c|d)++Y/BZ
3477    
3478    /(?(?=c)c|d)*+Y/BZ
3479    
3480    /a[\NB]c/
3481        aNc
3482    
3483    /a[B-\Nc]/
3484    
3485    /(a)(?2){0,1999}?(b)/
3486    
3487    /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
3488    
3489    /--- This test, with something more complicated than individual letters, causes
3490    different behaviour in Perl. Perhaps it disables some optimization; no tag is
3491    passed back for the failures, whereas in PCRE there is a tag. ---/
3492    
3493    /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
3494        AABC
3495        XXYZ
3496        ** Failers
3497        XAQQ
3498        XAQQXZZ
3499        AXQQQ
3500        AXXQQQ
3501    
3502    /-- Perl doesn't give marks for these, though it does if the alternatives are
3503    replaced by single letters. --/
3504    
3505    /(b|q)(*:m)f|a(*:n)w/K
3506        aw
3507        ** Failers
3508        abc
3509    
3510    /(q|b)(*:m)f|a(*:n)w/K
3511        aw
3512        ** Failers
3513        abc
3514    
3515    /-- After a partial match, the behaviour is as for a failure. --/
3516    
3517    /^a(*:X)bcde/K
3518       abc\P
3519    
3520    /-- These are here because Perl doesn't return a mark, except for the first --/
3521    
3522    /(?=(*:x))(q|)/K+
3523        abc
3524    
3525    /(?=(*:x))((*:y)q|)/K+
3526        abc
3527    
3528    /(?=(*:x))(?:(*:y)q|)/K+
3529        abc
3530    
3531    /(?=(*:x))(?>(*:y)q|)/K+
3532        abc
3533    
3534    /(?=a(*:x))(?!a(*:y)c)/K+
3535        ab
3536    
3537    /(?=a(*:x))(?=a(*:y)c|)/K+
3538        ab
3539    
3540    /(..)\1/
3541        ab\P
3542        aba\P
3543        abab\P
3544    
3545    /(..)\1/i
3546        ab\P
3547        abA\P
3548        aBAb\P
3549    
3550    /(..)\1{2,}/
3551        ab\P
3552        aba\P
3553        abab\P
3554        ababa\P
3555        ababab\P
3556        ababab\P\P
3557        abababa\P
3558        abababa\P\P
3559    
3560    /(..)\1{2,}/i
3561        ab\P
3562        aBa\P
3563        aBAb\P
3564        AbaBA\P
3565        abABAb\P
3566        aBAbaB\P\P
3567        abABabA\P
3568        abaBABa\P\P
3569    
3570    /(..)\1{2,}?x/i
3571        ab\P
3572        abA\P
3573        aBAb\P
3574        abaBA\P
3575        abAbaB\P
3576        abaBabA\P
3577        abAbABaBx\P
3578    
3579    /^(..)\1/
3580        aba\P
3581    
3582    /^(..)\1{2,3}x/
3583        aba\P
3584        ababa\P
3585        ababa\P\P
3586        abababx
3587        ababababx
3588    
3589    /^(..)\1{2,3}?x/
3590        aba\P
3591        ababa\P
3592        ababa\P\P
3593        abababx
3594        ababababx
3595    
3596    /^(..)(\1{2,3})ab/
3597        abababab
3598    
3599    /^\R/
3600        \r\P
3601        \r\P\P
3602    
3603    /^\R{2,3}x/
3604        \r\P
3605        \r\P\P
3606        \r\r\P
3607        \r\r\P\P
3608        \r\r\r\P
3609        \r\r\r\P\P
3610        \r\rx
3611        \r\r\rx
3612    
3613    /^\R{2,3}?x/
3614        \r\P
3615        \r\P\P
3616        \r\r\P
3617        \r\r\P\P
3618        \r\r\r\P
3619        \r\r\r\P\P
3620        \r\rx
3621        \r\r\rx
3622    
3623    /^\R?x/
3624        \r\P
3625        \r\P\P
3626        x
3627        \rx
3628    
3629    /^\R+x/
3630        \r\P
3631        \r\P\P
3632        \r\n\P
3633        \r\n\P\P
3634        \rx
3635    
3636    /^a$/<CRLF>
3637        a\r\P
3638        a\r\P\P
3639    
3640    /^a$/m<CRLF>
3641        a\r\P
3642        a\r\P\P
3643    
3644    /^(a$|a\r)/<CRLF>
3645        a\r\P
3646        a\r\P\P
3647    
3648    /^(a$|a\r)/m<CRLF>
3649        a\r\P
3650        a\r\P\P
3651    
3652    /./<CRLF>
3653        \r\P
3654        \r\P\P
3655    
3656    /.{2,3}/<CRLF>
3657        \r\P
3658        \r\P\P
3659        \r\r\P
3660        \r\r\P\P
3661        \r\r\r\P
3662        \r\r\r\P\P
3663    
3664    /.{2,3}?/<CRLF>
3665        \r\P
3666        \r\P\P
3667        \r\r\P
3668        \r\r\P\P
3669        \r\r\r\P
3670        \r\r\r\P\P
3671    
3672    "AB(C(D))(E(F))?(?(?=\2)(?=\4))"
3673        ABCDGHI\O03
3674    
3675    /-- These are all run as real matches in test 1; here we are just checking the
3676    settings of the anchored and startline bits. --/
3677    
3678    /(?>.*?a)(?<=ba)/I
3679    
3680    /(?:.*?a)(?<=ba)/I
3681    
3682    /.*?a(*PRUNE)b/I
3683    
3684    /.*?a(*PRUNE)b/sI
3685    
3686    /^a(*PRUNE)b/sI
3687    
3688    /.*?a(*SKIP)b/I
3689    
3690    /(?>.*?a)b/sI
3691    
3692    /(?>.*?a)b/I
3693    
3694    /(?>^a)b/sI
3695    
3696    /(?>.*?)(?<=(abcd)|(wxyz))/I
3697    
3698    /(?>.*)(?<=(abcd)|(wxyz))/I
3699    
3700    "(?>.*)foo"I
3701    
3702    "(?>.*?)foo"I
3703    
3704    /(?>^abc)/mI
3705    
3706    /(?>.*abc)/mI
3707    
3708    /(?:.*abc)/mI
3709    
3710    /-- Check PCRE_STUDY_EXTRA_NEEDED --/
3711    
3712    /.?/S-I
3713    
3714    /.?/S!I
3715    
3716    /(?:(a)+(?C1)bb|aa(?C2)b)/
3717        aab\C+
3718    
3719    /(?:(a)++(?C1)bb|aa(?C2)b)/
3720        aab\C+
3721    
3722    /(?:(?>(a))(?C1)bb|aa(?C2)b)/
3723        aab\C+
3724    
3725    /(?:(?1)(?C1)x|ab(?C2))((a)){0}/
3726        aab\C+
3727    
3728    /(?1)(?C1)((a)(?C2)){0}/
3729        aab\C+
3730    
3731    /(?:(a)+(?C1)bb|aa(?C2)b)++/
3732        aab\C+
3733        aab\C+\O2
3734    
3735    /(ab)x|ab/
3736        ab\O3
3737        ab\O2
3738    
3739    /(ab)/
3740        ab\O3
3741        ab\O2
3742    
3743    /(?<=123)(*MARK:xx)abc/K
3744        xxxx123a\P\P
3745        xxxx123a\P
3746    
3747    /123\Kabc/
3748        xxxx123a\P\P
3749        xxxx123a\P
3750    
3751    /^(?(?=a)aa|bb)/C
3752        bb
3753    
3754    /(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/
3755        bb
3756    
3757    /-- Perl seems to have a bug with this one --/
3758    
3759    /aaaaa(*COMMIT)(*PRUNE)b|a+c/
3760        aaaaaac
3761    
3762    /-- Here are some that Perl treats differently because of the way it handles
3763    backtracking verbs. --/
3764    
3765     /^(?!a(*SKIP)b)/
3766         ac
3767    
3768     /^(?!a(*SKIP)b)../
3769         acd
3770    
3771    /(?!a(*SKIP)b)../
3772         acd
3773    
3774    /^(?(?!a(*SKIP)b))/
3775         ac
3776    
3777    /^(?!a(*PRUNE)b)../
3778         acd
3779    
3780    /(?!a(*PRUNE)b)../
3781         acd
3782    
3783     /(?!a(*COMMIT)b)ac|cd/
3784         ac
3785    
3786     /(?!a(*COMMIT)b)ac|ad/
3787         ac
3788         ad
3789    
3790    /^(?!a(*THEN)b|ac)../
3791         ac
3792         ad
3793    
3794    /^(?=a(*THEN)b|ac)/
3795        ac
3796    
3797    /\A.*?(?:a|b(*THEN)c)/
3798        ba
3799    
3800    /\A.*?(?:a|bc)/
3801        ba
3802    
3803    /\A.*?(?:a|b(*THEN)c)++/
3804        ba
3805    
3806    /\A.*?(?:a|b(*THEN)c|d)/
3807        ba
3808    
3809    /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/
3810        aac
3811    
3812    /\A.*?(a|b(*THEN)c)/
3813        ba
3814    
3815    /^(A(*THEN)B|C(*THEN)D)/
3816        CD
3817    
3818    /^(A(*THEN)B|A(*THEN)D)/
3819        AD
3820    
3821    /(?!b(*THEN)a)bn|bnn/
3822        bnn
3823    
3824    /(?(?=b(*SKIP)a)bn|bnn)/
3825        bnn
3826    
3827    /(?=b(*THEN)a|)bn|bnn/
3828        bnn
3829    
3830    /-------------------------/
3831    
3832    /-- End of testinput2 --/

Legend:
Removed from v.247  
changed lines
  Added in v.1302

  ViewVC Help
Powered by ViewVC 1.1.5