/[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 453 by ph10, Fri Sep 18 19:12:35 2009 UTC revision 915 by zherczeg, Tue Feb 14 13:05:39 2012 UTC
# Line 2  Line 2 
2      of PCRE's API, error diagnostics, and the compiled code of some patterns.      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,      It also checks the non-Perl syntax the PCRE supports (Python, .NET,
4      Oniguruma). Finally, there are some tests where PCRE and Perl differ,      Oniguruma). Finally, there are some tests where PCRE and Perl differ,
5      either because PCRE can't be compatible, or there is potential Perl      either because PCRE can't be compatible, or there is a possible Perl
6      bug. --/      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    
 /-- Originally, the Perl 5.10 things were in here too, but now I have separated  
     many (most?) of them out into test 11. However, there may still be some  
     that were overlooked. --/  
   
11  /(a)b|/I  /(a)b|/I
12    
13  /abc/I  /abc/I
# Line 51  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 134  Line 143 
143      defabc      defabc
144      \Zdefabc      \Zdefabc
145    
 /abc/P  
     abc  
     *** Failers  
   
 /^abc|def/P  
     abcdef  
     abcdef\B  
   
 /.*((abc)$|(def))/P  
     defabc  
     \Zdefabc  
   
 /the quick brown fox/P  
     the quick brown fox  
     *** Failers  
     The Quick Brown Fox  
   
 /the quick brown fox/Pi  
     the quick brown fox  
     The Quick Brown Fox  
   
 /abc.def/P  
     *** Failers  
     abc\ndef  
   
 /abc$/P  
     abc  
     abc\n  
   
 /(abc)\2/P  
   
 /(abc\1)/P  
     abc  
   
146  /)/  /)/
147    
148  /a[]b/  /a[]b/
# Line 344  Line 319 
319      *** Failers      *** Failers
320      a      a
321    
322  /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
323    
324  /^(a\1?){4}$/I  /^(a\1?){4}$/I
325        aaaa
326      aaaaaa      aaaaaa
327    
328    /Perl does not fail these two for the final subjects. Neither did PCRE until/
329    /release 8.01. The problem is in backtracking into a subpattern that contains/
330    /a recursive reference to itself. PCRE has now made these into atomic patterns./
331    
332    /^(xa|=?\1a){2}$/
333        xa=xaa
334        ** Failers
335        xa=xaaa
336    
337    /^(xa|=?\1a)+$/
338        xa=xaa
339        ** Failers
340        xa=xaaa
341    
342  /These are syntax tests from Perl 5.005/I  /These are syntax tests from Perl 5.005/I
343    
# Line 417  Line 407 
407    
408  /abc/\  /abc/\
409    
 /abc/\P  
   
410  /abc/\i  /abc/\i
411    
412  /(a)bc(d)/I  /(a)bc(d)/I
# Line 466  Line 454 
454  /\Biss\B/I+  /\Biss\B/I+
455      Mississippi      Mississippi
456    
 /\Biss\B/I+P  
     Mississippi  
   
457  /iss/IG+  /iss/IG+
458      Mississippi      Mississippi
459    
# Line 604  Line 589 
589      *** Failers      *** Failers
590      \Nabc      \Nabc
591    
 /a*(b+)(z)(z)/P  
     aaaabbbbzzzz  
     aaaabbbbzzzz\O0  
     aaaabbbbzzzz\O1  
     aaaabbbbzzzz\O2  
     aaaabbbbzzzz\O3  
     aaaabbbbzzzz\O4  
     aaaabbbbzzzz\O5  
   
592  /^.?abcd/IS  /^.?abcd/IS
593    
594  /\(             # ( at start  /\(             # ( at start
# Line 1036  Line 1012 
1012  /abc(?C)de(?C1)f/I  /abc(?C)de(?C1)f/I
1013      123abcdef      123abcdef
1014    
1015  /(?C1)\dabc(?C2)def/I  /(?C1)\dabc(?C2)def/IS
1016        1234abcdef
1017        *** Failers
1018        abcdef
1019    
1020    /(?C1)\dabc(?C2)def/ISS
1021      1234abcdef      1234abcdef
1022      *** Failers      *** Failers
1023      abcdef      abcdef
# Line 1285  Line 1266 
1266    abcde    abcde
1267    abcdfe    abcdfe
1268    
1269  /a*b/ICDZ  /a*b/ICDZS
1270      ab
1271      aaaab
1272      aaaacb
1273    
1274    /a*b/ICDZSS
1275    ab    ab
1276    aaaab    aaaab
1277    aaaacb    aaaacb
# Line 1295  Line 1281 
1281    aaaab    aaaab
1282    aaaacb    aaaacb
1283    
1284  /(abc|def)x/ICDZ  /(abc|def)x/ICDZS
1285      abcx
1286      defx
1287      ** Failers
1288      abcdefzx
1289    
1290    /(abc|def)x/ICDZSS
1291    abcx    abcx
1292    defx    defx
1293      ** Failers
1294    abcdefzx    abcdefzx
1295    
1296  /(ab|cd){3,4}/IC  /(ab|cd){3,4}/IC
# Line 1305  Line 1298 
1298    abcdabcd    abcdabcd
1299    abcdcdcdcdcd    abcdcdcdcdcd
1300    
1301  /([ab]{,4}c|xy)/ICDZ  /([ab]{,4}c|xy)/ICDZS
1302        Note: that { does NOT introduce a quantifier
1303    
1304    /([ab]{,4}c|xy)/ICDZSS
1305      Note: that { does NOT introduce a quantifier      Note: that { does NOT introduce a quantifier
1306    
1307  /([ab]{1,4}c|xy){4,5}?123/ICDZ  /([ab]{1,4}c|xy){4,5}?123/ICDZ
# Line 1379  Line 1375 
1375      1X      1X
1376      123456\P      123456\P
1377    
1378  /abc/I>testsavedregex  /abc/IS>testsavedregex
1379    <testsavedregex
1380        abc
1381        ** Failers
1382        bca
1383    
1384    /abc/ISS>testsavedregex
1385    <testsavedregex
1386        abc
1387        ** Failers
1388        bca
1389    
1390    /abc/IFS>testsavedregex
1391  <testsavedregex  <testsavedregex
1392      abc      abc
1393      ** Failers      ** Failers
1394      bca      bca
1395    
1396  /abc/IF>testsavedregex  /abc/IFSS>testsavedregex
1397  <testsavedregex  <testsavedregex
1398      abc      abc
1399      ** Failers      ** Failers
# Line 1397  Line 1405 
1405      ** Failers      ** Failers
1406      def      def
1407    
1408    /(a|b)/ISS>testsavedregex
1409    <testsavedregex
1410        abc
1411        ** Failers
1412        def
1413    
1414  /(a|b)/ISF>testsavedregex  /(a|b)/ISF>testsavedregex
1415  <testsavedregex  <testsavedregex
1416      abc      abc
1417      ** Failers      ** Failers
1418      def      def
1419    
1420    /(a|b)/ISSF>testsavedregex
1421    <testsavedregex
1422        abc
1423        ** Failers
1424        def
1425    
1426  ~<(\w+)/?>(.)*</(\1)>~smgI  ~<(\w+)/?>(.)*</(\1)>~smgI
1427      <!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>
1428    
1429  /^a/IF  /^a/IF
1430    
# Line 1422  Line 1442 
1442      ** Failers      ** Failers
1443      line one\nthis is a line\nbreak in the second line      line one\nthis is a line\nbreak in the second line
1444    
 /ab.cd/P  
     ab-cd  
     ab=cd  
     ** Failers  
     ab\ncd  
   
 /ab.cd/Ps  
     ab-cd  
     ab=cd  
     ab\ncd  
   
1445  /(?i)(?-i)AbCd/I  /(?i)(?-i)AbCd/I
1446      AbCd      AbCd
1447      ** Failers      ** Failers
# Line 1483  Line 1492 
1492      (this)      (this)
1493      ((this))      ((this))
1494    
 /a(b)c/PN  
     abc  
   
 /a(?P<name>b)c/PN  
     abc  
   
 /\x{100}/I  
   
1495  /\x{0000ff}/I  /\x{0000ff}/I
1496    
1497  /^((?P<A>a1)|(?P<A>a2)b)/I  /^((?P<A>a1)|(?P<A>a2)b)/I
# Line 1568  a random value. /Ix Line 1569  a random value. /Ix
1569  /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I  /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1570      bXXaYYaY      bXXaYYaY
1571    
 /\777/I  
   
1572  /\s*,\s*/IS  /\s*,\s*/IS
1573      \x0b,\x0b      \x0b,\x0b
1574      \x0c,\x0d      \x0c,\x0d
# Line 1951  a random value. /Ix Line 1950  a random value. /Ix
1950    
1951  /(?(DEFINE) abc) xyz/xI  /(?(DEFINE) abc) xyz/xI
1952    
 /(?(DEFINE) abc){3} xyz/x  
   
1953  /(a|)*\d/  /(a|)*\d/
1954    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1955    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
# Line 2174  a random value. /Ix Line 2171  a random value. /Ix
2171      xabcpqrx      xabcpqrx
2172      xxyzx      xxyzx
2173    
 /[\h]/BZ  
     >\x09<  
   
 /[\h]+/BZ  
     >\x09\x20\xa0<  
   
 /[\v]/BZ  
   
 /[\H]/BZ  
   
 /[^\h]/BZ  
   
 /[\V]/BZ  
   
 /[\x0a\V]/BZ  
   
2174  /\H++X/BZ  /\H++X/BZ
2175      ** Failers      ** Failers
2176      XXXX      XXXX
# Line 2230  a random value. /Ix Line 2211  a random value. /Ix
2211  /\V+\v\V+\w/BZ  /\V+\v\V+\w/BZ
2212    
2213  /\( (?: [^()]* | (?R) )* \)/x  /\( (?: [^()]* | (?R) )* \)/x
2214  (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(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)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)
2215    
2216  /[\E]AAA/  /[\E]AAA/
2217    
# Line 2264  a random value. /Ix Line 2245  a random value. /Ix
2245  /a+b?(*THEN)c+(*FAIL)/C  /a+b?(*THEN)c+(*FAIL)/C
2246      aaabccc      aaabccc
2247    
 /a(*PRUNE:XXX)b/  
   
2248  /a(*MARK)b/  /a(*MARK)b/
2249    
2250  /(?i:A{1,}\6666666666)/  /(?i:A{1,}\6666666666)/
2251    
2252  /\g6666666666/  /\g6666666666/
2253    
2254  /[\g6666666666]/  /[\g6666666666]/BZ
2255    
2256  /(?1)\c[/  /(?1)\c[/
2257    
# Line 2323  a random value. /Ix Line 2302  a random value. /Ix
2302      a\nb      a\nb
2303      a\r\nb      a\r\nb
2304      a\x85b      a\x85b
2305    
2306    /(*ANY).*/g
2307        abc\r\ndef
2308    
2309    /(*ANYCRLF).*/g
2310        abc\r\ndef
2311    
2312    /(*CRLF).*/g
2313        abc\r\ndef
2314    
2315  /a\Rb/I<bsr_anycrlf>  /a\Rb/I<bsr_anycrlf>
2316      a\rb      a\rb
# Line 2421  a random value. /Ix Line 2409  a random value. /Ix
2409    
2410  /\k{}/  /\k{}/
2411    
2412    /\k/
2413    
2414    /\kabc/
2415    
2416  /(?P=)/  /(?P=)/
2417    
2418  /(?P>)/  /(?P>)/
# Line 2538  a random value. /Ix Line 2530  a random value. /Ix
2530    
2531  /(?(?=.*b).*b|^d)/I  /(?(?=.*b).*b|^d)/I
2532    
 /a?|b?/P  
     abc  
     ** Failers  
     ddd\N  
   
2533  /xyz/C  /xyz/C
2534    xyz    xyz
2535    abcxyz    abcxyz
# Line 2552  a random value. /Ix Line 2539  a random value. /Ix
2539    abc\Y    abc\Y
2540    abcxypqr    abcxypqr
2541    abcxypqr\Y    abcxypqr\Y
2542    
2543    /(*NO_START_OPT)xyz/C
2544      abcxyz
2545    
2546    /xyz/CY
2547      abcxyz
2548    
2549  /^"((?(?=[a])[^"])|b)*"$/C  /^"((?(?=[a])[^"])|b)*"$/C
2550      "ab"      "ab"
# Line 2728  a random value. /Ix Line 2721  a random value. /Ix
2721     abc\P     abc\P
2722     abc\P\P     abc\P\P
2723    
 /\w+A/P  
    CDAAAAB  
   
 /\w+A/PU  
    CDAAAAB  
   
2724  /abc\K123/  /abc\K123/
2725      xyzabc123pqr      xyzabc123pqr
2726      xyzabc12\P      xyzabc12\P
# Line 2845  a random value. /Ix Line 2832  a random value. /Ix
2832  /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/  /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
2833      XYabcdY      XYabcdY
2834    
2835    /(?<=b(?1)|zzz)(a)/
2836        xbaax
2837        xzzzax
2838    
2839    /(a)(?<=b\1)/
2840    
2841    /(a)(?<=b+(?1))/
2842    
2843    /(a+)(?<=b(?1))/
2844    
2845    /(a(?<=b(?1)))/
2846    
2847    /(?<=b(?1))xyz/
2848    
2849    /(?<=b(?1))xyz(b+)pqrstuvew/
2850    
2851    /(a|bc)\1/SI
2852    
2853    /(a|bc)\1{2,3}/SI
2854    
2855    /(a|bc)(?1)/SI
2856    
2857    /(a|b\1)(a|b\1)/SI
2858    
2859    /(a|b\1){2}/SI
2860    
2861    /(a|bbbb\1)(a|bbbb\1)/SI
2862    
2863    /(a|bbbb\1){2}/SI
2864    
2865    /^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
2866    
2867    /<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
2868    
2869    "(?>.*/)foo"SI
2870    
2871    /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /xSI
2872    
2873    /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
2874    
2875    /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
2876    
2877    /<a[\s]+href[\s]*=[\s]*          # find <a href=
2878     ([\"\'])?                       # find single or double quote
2879     (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
2880                                     # quote, otherwise match up to next space
2881    /isxSI
2882    
2883    /^(?!:)                       # colon disallowed at start
2884      (?:                         # start of item
2885        (?: [0-9a-f]{1,4} |       # 1-4 hex digits or
2886        (?(1)0 | () ) )           # if null previously matched, fail; else null
2887        :                         # followed by colon
2888      ){1,7}                      # end item; 1-7 of them required
2889      [0-9a-f]{1,4} $             # final hex number at end of string
2890      (?(1)|.)                    # check that there was an empty component
2891      /xiIS
2892    
2893    /(?|(?<a>A)|(?<a>B))/I
2894        AB\Ca
2895        BA\Ca
2896    
2897    /(?|(?<a>A)|(?<b>B))/
2898    
2899    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
2900        b(?<quote> (?<apostrophe>')|(?<realquote>")) )
2901        (?('quote')[a-z]+|[0-9]+)/JIx
2902        a"aaaaa
2903        b"aaaaa
2904        ** Failers
2905        b"11111
2906        a"11111
2907    
2908    /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
2909        abcdX
2910        eX
2911        ** Failers
2912        abcdY
2913        ey
2914    
2915    /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/JDZx
2916        abcdd
2917        ** Failers
2918        abcdde
2919    
2920    /abcd*/
2921        xxxxabcd\P
2922        xxxxabcd\P\P
2923    
2924    /abcd*/i
2925        xxxxabcd\P
2926        xxxxabcd\P\P
2927        XXXXABCD\P
2928        XXXXABCD\P\P
2929    
2930    /abc\d*/
2931        xxxxabc1\P
2932        xxxxabc1\P\P
2933    
2934    /(a)bc\1*/
2935        xxxxabca\P
2936        xxxxabca\P\P
2937    
2938    /abc[de]*/
2939        xxxxabcde\P
2940        xxxxabcde\P\P
2941    
2942    /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
2943        broken and not behaving as specified in that it *does* bumpalong after
2944        hitting (*COMMIT). --/
2945    
2946    /(?1)(A(*COMMIT)|B)D/
2947        ABD
2948        XABD
2949        BAD
2950        ABXABD
2951        ** Failers
2952        ABX
2953        BAXBAD
2954    
2955    /(\3)(\1)(a)/<JS>
2956        cat
2957    
2958    /(\3)(\1)(a)/SI<JS>
2959        cat
2960    
2961    /(\3)(\1)(a)/SI
2962        cat
2963    
2964    /i(?(DEFINE)(?<s>a))/SI
2965        i
2966    
2967    /()i(?(1)a)/SI
2968        ia
2969    
2970    /(?i)a(?-i)b|c/BZ
2971        XabX
2972        XAbX
2973        CcC
2974        ** Failers
2975        XABX
2976    
2977    /(?i)a(?s)b|c/BZ
2978    
2979    /(?i)a(?s-i)b|c/BZ
2980    
2981    /^(ab(c\1)d|x){2}$/BZ
2982        xabcxd
2983    
2984    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
2985    
2986    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
2987    
2988    / -- The first four of these are not in the Perl >= 5.10 test because Perl
2989         documents that the use of \K in assertions is "not well defined". The
2990         last is here because Perl gives the match as "b" rather than "ab". I
2991         believe this to be a Perl bug. --/
2992    
2993    /(?=a\Kb)ab/
2994        ab
2995    
2996    /(?!a\Kb)ac/
2997        ac
2998    
2999    /^abc(?<=b\Kc)d/
3000        abcd
3001    
3002    /^abc(?<!b\Kq)d/
3003        abcd
3004    
3005    /(?>a\Kb)z|(ab)/
3006        ab
3007    
3008    /----------------------/
3009    
3010    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
3011    
3012    /abc(*MARK:)pqr/
3013    
3014    /abc(*:)pqr/
3015    
3016    /abc(*FAIL:123)xyz/
3017    
3018    /--- This should, and does, fail. In Perl, it does not, which I think is a
3019         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
3020    
3021    /A(*COMMIT)B/+K
3022        ACABX
3023    
3024    /--- These should be different, but in Perl 5.11 are not, which I think
3025         is a bug in Perl. ---/
3026    
3027    /A(*THEN)B|A(*THEN)C/K
3028        AC
3029    
3030    /A(*PRUNE)B|A(*PRUNE)C/K
3031        AC
3032    
3033    /--- This should fail; the SKIP advances by one, but when we get to AC, the
3034         PRUNE kills it. Perl behaves differently. ---/
3035    
3036    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
3037        AAAC
3038    
3039    /--- Mark names can be duplicated. Perl doesn't give a mark for this one,
3040    though PCRE does. ---/
3041    
3042    /^A(*:A)B|^X(*:A)Y/K
3043        ** Failers
3044        XAQQ
3045    
3046    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3047    optimizations defeat this. So does the PCRE optimization unless we disable it
3048    with \Y. ---/
3049    
3050    /(*COMMIT)ABC/
3051        ABCDEFG
3052        ** Failers
3053        DEFGABC\Y
3054    
3055    /^(ab (c+(*THEN)cd) | xyz)/x
3056        abcccd
3057    
3058    /^(ab (c+(*PRUNE)cd) | xyz)/x
3059        abcccd
3060    
3061    /^(ab (c+(*FAIL)cd) | xyz)/x
3062        abcccd
3063    
3064    /--- Perl 5.11 gets some of these wrong ---/
3065    
3066    /(?>.(*ACCEPT))*?5/
3067        abcde
3068    
3069    /(.(*ACCEPT))*?5/
3070        abcde
3071    
3072    /(.(*ACCEPT))5/
3073        abcde
3074    
3075    /(.(*ACCEPT))*5/
3076        abcde
3077    
3078    /A\NB./BZ
3079        ACBD
3080        *** Failers
3081        A\nB
3082        ACB\n
3083    
3084    /A\NB./sBZ
3085        ACBD
3086        ACB\n
3087        *** Failers
3088        A\nB
3089    
3090    /A\NB/<crlf>
3091        A\nB
3092        A\rB
3093        ** Failers
3094        A\r\nB
3095    
3096    /\R+b/BZ
3097    
3098    /\R+\n/BZ
3099    
3100    /\R+\d/BZ
3101    
3102    /\d*\R/BZ
3103    
3104    /\s*\R/BZ
3105    
3106    /-- Perl treats this one differently, not failing the second string. I believe
3107        that is a bug in Perl. --/
3108    
3109    /^((abc|abcx)(*THEN)y|abcd)/
3110        abcd
3111        *** Failers
3112        abcxy
3113    
3114    /(?<=abc)def/
3115        abc\P\P
3116    
3117    /abc$/
3118        abc
3119        abc\P
3120        abc\P\P
3121    
3122    /abc$/m
3123        abc
3124        abc\n
3125        abc\P\P
3126        abc\n\P\P
3127        abc\P
3128        abc\n\P
3129    
3130    /abc\z/
3131        abc
3132        abc\P
3133        abc\P\P
3134    
3135    /abc\Z/
3136        abc
3137        abc\P
3138        abc\P\P
3139    
3140    /abc\b/
3141        abc
3142        abc\P
3143        abc\P\P
3144    
3145    /abc\B/
3146        abc
3147        abc\P
3148        abc\P\P
3149    
3150    /.+/
3151        abc\>0
3152        abc\>1
3153        abc\>2
3154        abc\>3
3155        abc\>4
3156        abc\>-4
3157    
3158    /^\cģ/
3159    
3160    /(?P<abn>(?P=abn)xxx)/BZ
3161    
3162    /(a\1z)/BZ
3163    
3164    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
3165    
3166    /(?P<abn>(?P=axn)xxx)/BZ
3167    
3168    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
3169    
3170    /-- These tests are here because Perl gets the first one wrong. --/
3171    
3172    /(\R*)(.)/s
3173        \r\n
3174        \r\r\n\n\r
3175        \r\r\n\n\r\n
3176    
3177    /(\R)*(.)/s
3178        \r\n
3179        \r\r\n\n\r
3180        \r\r\n\n\r\n
3181    
3182    /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
3183        \r\n
3184        \r\r\n\n\r
3185        \r\r\n\n\r\n
3186    
3187    /-- --/
3188    
3189    /^abc$/BZ
3190    
3191    /^abc$/BZm
3192    
3193    /^(a)*+(\w)/S
3194        aaaaX
3195        ** Failers
3196        aaaa
3197    
3198    /^(?:a)*+(\w)/S
3199        aaaaX
3200        ** Failers
3201        aaaa
3202    
3203    /(a)++1234/SDZ
3204    
3205    /([abc])++1234/SI
3206    
3207    /(?<=(abc)+)X/
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    /(?:^ab|^)++/I
3224    
3225    /(.*ab)/I
3226    
3227    /(.*ab)++/I
3228    
3229    /(.*ab|.*)+/I
3230    
3231    /(.*ab|.*)++/I
3232    
3233    /(?:.*ab)/I
3234    
3235    /(?:.*ab)++/I
3236    
3237    /(?:.*ab|.*)+/I
3238    
3239    /(?:.*ab|.*)++/I
3240    
3241    /(?=a)[bcd]/I
3242    
3243    /((?=a))[bcd]/I
3244    
3245    /((?=a))+[bcd]/I
3246    
3247    /((?=a))++[bcd]/I
3248    
3249    /(?=a+)[bcd]/iI
3250    
3251    /(?=a+?)[bcd]/iI
3252    
3253    /(?=a++)[bcd]/iI
3254    
3255    /(?=a{3})[bcd]/iI
3256    
3257    /(abc)\1+/S
3258    
3259    /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
3260    
3261    /(?1)(?:(b(*ACCEPT))){0}/
3262        b
3263    
3264    /(?1)(?:(b(*ACCEPT))){0}c/
3265        bc
3266        ** Failers
3267        b
3268    
3269    /(?1)(?:((*ACCEPT))){0}c/
3270        c
3271        c\N
3272    
3273    /^.*?(?(?=a)a|b(*THEN)c)/
3274        ba
3275    
3276    /^.*?(?(?=a)a|bc)/
3277        ba
3278    
3279    /^.*?(?(?=a)a(*THEN)b|c)/
3280        ac
3281    
3282    /^.*?(?(?=a)a(*THEN)b)c/
3283        ac
3284    
3285    /^.*?(a(*THEN)b)c/
3286        aabc
3287    
3288    /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
3289        aabc
3290    
3291    /^.*?(a(*THEN)b|z)c/
3292        aabc
3293    
3294    /^.*?(z|a(*THEN)b)c/
3295        aabc
3296    
3297    /-- --/
3298    
3299    /-- These studied versions are here because they are not Perl-compatible; the
3300        studying means the mark is not seen. --/
3301    
3302    /(*MARK:A)(*SKIP:B)(C|X)/KS
3303        C
3304        D
3305    
3306    /(*:A)A+(*SKIP:A)(B|Z)/KS
3307        AAAC
3308    
3309    /-- --/
3310    
3311    "(?=a*(*ACCEPT)b)c"
3312        c
3313        c\N
3314    
3315    /(?1)c(?(DEFINE)((*ACCEPT)b))/
3316        c
3317        c\N
3318    
3319    /(?>(*ACCEPT)b)c/
3320        c
3321        c\N
3322    
3323    /(?:(?>(a)))+a%/++
3324        %aa%
3325    
3326    /(a)b|ac/++SS
3327        ac\O3
3328    
3329    /(a)(b)x|abc/++
3330         abc\O6
3331    
3332    /(a)bc|(a)(b)\2/
3333        \O3abc
3334        \O4abc
3335    
3336    /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI
3337    
3338    /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
3339    
3340    /(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
3341    
3342    /(abc)(?1)/SI
3343    
3344    /^(?>a)++/
3345        aa\M
3346        aaaaaaaaa\M
3347    
3348    /(a)(?1)++/
3349        aa\M
3350        aaaaaaaaa\M
3351    
3352    /(?:(foo)|(bar)|(baz))X/SS=
3353        bazfooX
3354        foobazbarX
3355        barfooX
3356        bazX
3357        foobarbazX
3358        bazfooX\O0
3359        bazfooX\O2
3360        bazfooX\O4
3361        bazfooX\O6
3362        bazfooX\O8
3363        bazfooX\O10
3364    
3365    /(?=abc){3}abc/BZ
3366    
3367    /(?=abc)+abc/BZ
3368    
3369    /(?=abc)++abc/BZ
3370    
3371    /(?=abc){0}xyz/BZ
3372    
3373    /(?=(a))?./BZ
3374    
3375    /(?=(a))??./BZ
3376    
3377    /^(?=(a)){0}b(?1)/BZ
3378    
3379    /(?(DEFINE)(a))?b(?1)/BZ
3380    
3381    /^(?=(?1))?[az]([abc])d/BZ
3382    
3383    /^(?!a){0}\w+/BZ
3384    
3385    /(?<=(abc))?xyz/BZ
3386    
3387    /[:a[:abc]b:]/BZ
3388    
3389    /((?2))((?1))/SS
3390        abc
3391    
3392    /((?(R2)a+|(?1)b))/SS
3393        aaaabcde
3394    
3395    /(?(R)a*(?1)|((?R))b)/SS
3396        aaaabcde
3397    
3398    /(a+|(?R)b)/
3399    
3400    /^(a(*:A)(d|e(*:B))z|aeq)/C
3401        adz
3402        aez
3403        aeqwerty
3404    
3405    /.(*F)/
3406        \P\Pabc
3407    
3408    /\btype\b\W*?\btext\b\W*?\bjavascript\b/IS
3409    
3410    /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS
3411    
3412    /a(*SKIP)c|b(*ACCEPT)|/+SI
3413        a
3414    
3415    /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/SI
3416        ax
3417    
3418    'a*(*ACCEPT)b'+
3419        \N\N
3420        abc\N\N
3421        bbb\N\N
3422    
3423    /(*ACCEPT)a/+I
3424        bax
3425    
3426    /z(*ACCEPT)a/+I
3427        baxzbx
3428    
3429    /a(?:.)*?a/ims
3430        \Mabbbbbbbbbbbbbbbbbbbbba
3431    
3432    /a(?:.(*THEN))*?a/ims
3433        \Mabbbbbbbbbbbbbbbbbbbbba
3434    
3435    /a(?:.(*THEN:ABC))*?a/ims
3436        \Mabbbbbbbbbbbbbbbbbbbbba
3437    
3438    /-- These tests are in agreement with development Perl 5.015, which has fixed
3439        some things, but they don't all work with 5.012, so they aren't in the
3440        Perl-compatible tests. Those after the first come from Perl's own test
3441        files. --/
3442    
3443    /^((yes|no)(*THEN)(*F))?/
3444      yes
3445    
3446    /(A (.*)   C? (*THEN)  | A D) (*FAIL)/x
3447    AbcdCBefgBhiBqz
3448    
3449    /(A (.*)   C? (*THEN)  | A D) z/x
3450    AbcdCBefgBhiBqz
3451    
3452    /(A (.*)   C? (*THEN)  | A D) \s* (*FAIL)/x
3453    AbcdCBefgBhiBqz
3454    
3455    /(A (.*)   C? (*THEN)  | A D) \s* z/x
3456    AbcdCBefgBhiBqz
3457    
3458    /(A (.*)   (?:C|) (*THEN)  | A D) (*FAIL)/x
3459    AbcdCBefgBhiBqz
3460    
3461    /(A (.*)   (?:C|) (*THEN)  | A D) z/x
3462    AbcdCBefgBhiBqz
3463    
3464    /(A (.*)   C{0,6} (*THEN)  | A D) (*FAIL)/x
3465    AbcdCBefgBhiBqz
3466    
3467    /(A (.*)   C{0,6} (*THEN)  | A D) z/x
3468    AbcdCBefgBhiBqz
3469    
3470    /(A (.*)   (CE){0,6} (*THEN)  | A D) (*FAIL)/x
3471    AbcdCEBefgBhiBqz
3472    
3473    /(A (.*)   (CE){0,6} (*THEN)  | A D) z/x
3474    AbcdCEBefgBhiBqz
3475    
3476    /(A (.*)   (CE*){0,6} (*THEN)  | A D) (*FAIL)/x
3477    AbcdCBefgBhiBqz
3478    
3479    /(A (.*)   (CE*){0,6} (*THEN)  | A D) z/x
3480    AbcdCBefgBhiBqz
3481    
3482    /-----------------------------------------------/
3483    
3484    /^(?>a+)(?>(z+))\w/BZ
3485        aaaazzzzb
3486        ** Failers
3487        aazz
3488    
3489    /(.)(\1|a(?2))/
3490        bab
3491    
3492    /\1|(.)(?R)\1/
3493        cbbbc
3494    
3495    /(.)((?(1)c|a)|a(?2))/
3496        baa
3497    
3498    /(?P<abn>(?P=abn)xxx)/BZ
3499    
3500    /(a\1z)/BZ
3501    
3502    /^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
3503         \Maabbccddee
3504    
3505    /^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
3506         \Maabbccddee
3507    
3508    /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
3509         \Maabbccddee
3510    
3511    /^a\x41z/<JS>
3512        aAz
3513        *** Failers
3514        ax41z
3515    
3516    /^a[m\x41]z/<JS>
3517        aAz
3518    
3519    /^a\x1z/<JS>
3520        ax1z
3521    
3522    /^a\u0041z/<JS>
3523        aAz
3524        *** Failers
3525        au0041z
3526    
3527    /^a[m\u0041]z/<JS>
3528        aAz
3529    
3530    /^a\u041z/<JS>
3531        au041z
3532        *** Failers
3533        aAz
3534    
3535    /^a\U0041z/<JS>
3536        aU0041z
3537        *** Failers
3538        aAz
3539    
3540    /(?(?=c)c|d)++Y/BZ
3541    
3542    /(?(?=c)c|d)*+Y/BZ
3543    
3544    /a[\NB]c/
3545        aNc
3546    
3547    /a[B-\Nc]/
3548    
3549    /(a)(?2){0,1999}?(b)/
3550    
3551    /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
3552    
3553    /--- This test, with something more complicated than individual letters, causes
3554    different behaviour in Perl. Perhaps it disables some optimization; no tag is
3555    passed back for the failures, whereas in PCRE there is a tag. ---/
3556    
3557    /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
3558        AABC
3559        XXYZ
3560        ** Failers
3561        XAQQ
3562        XAQQXZZ
3563        AXQQQ
3564        AXXQQQ
3565    
3566    /-- Perl doesn't give marks for these, though it does if the alternatives are
3567    replaced by single letters. --/
3568    
3569    /(b|q)(*:m)f|a(*:n)w/K
3570        aw
3571        ** Failers
3572        abc
3573    
3574    /(q|b)(*:m)f|a(*:n)w/K
3575        aw
3576        ** Failers
3577        abc
3578    
3579    /-- After a partial match, the behaviour is as for a failure. --/
3580    
3581    /^a(*:X)bcde/K
3582       abc\P
3583    
3584    /-- These are here because Perl doesn't return a mark, except for the first --/
3585    
3586    /(?=(*:x))(q|)/K+
3587        abc
3588    
3589    /(?=(*:x))((*:y)q|)/K+
3590        abc
3591    
3592    /(?=(*:x))(?:(*:y)q|)/K+
3593        abc
3594    
3595    /(?=(*:x))(?>(*:y)q|)/K+
3596        abc
3597    
3598    /(?=a(*:x))(?!a(*:y)c)/K+
3599        ab
3600    
3601    /(?=a(*:x))(?=a(*:y)c|)/K+
3602        ab
3603    
3604    /(..)\1/
3605        ab\P
3606        aba\P
3607        abab\P
3608    
3609    /(..)\1/i
3610        ab\P
3611        abA\P
3612        aBAb\P
3613    
3614    /(..)\1{2,}/
3615        ab\P
3616        aba\P
3617        abab\P
3618        ababa\P
3619        ababab\P
3620        ababab\P\P
3621        abababa\P
3622        abababa\P\P
3623    
3624    /(..)\1{2,}/i
3625        ab\P
3626        aBa\P
3627        aBAb\P
3628        AbaBA\P
3629        abABAb\P
3630        aBAbaB\P\P
3631        abABabA\P
3632        abaBABa\P\P
3633    
3634    /(..)\1{2,}?x/i
3635        ab\P
3636        abA\P
3637        aBAb\P
3638        abaBA\P
3639        abAbaB\P
3640        abaBabA\P
3641        abAbABaBx\P
3642    
3643  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.453  
changed lines
  Added in v.915

  ViewVC Help
Powered by ViewVC 1.1.5