/[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 143 by ph10, Mon Apr 2 10:08:14 2007 UTC revision 457 by ph10, Sat Oct 3 16:24:08 2009 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 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
# Line 28  Line 39 
39      *** Failers      *** Failers
40      def\nabc      def\nabc
41    
42  /ab\hdef/X  /ab\idef/X
43    
44  /(?X)ab\hdef/X  /(?X)ab\idef/X
45    
46  /x{5,4}/  /x{5,4}/
47    
# Line 123  Line 134 
134      defabc      defabc
135      \Zdefabc      \Zdefabc
136    
137  /abc/IP  /abc/P
138      abc      abc
139      *** Failers      *** Failers
140    
141  /^abc|def/IP  /^abc|def/P
142      abcdef      abcdef
143      abcdef\B      abcdef\B
144    
145  /.*((abc)$|(def))/IP  /.*((abc)$|(def))/P
146      defabc      defabc
147      \Zdefabc      \Zdefabc
148    
149  /the quick brown fox/IP  /the quick brown fox/P
150      the quick brown fox      the quick brown fox
151      *** Failers      *** Failers
152      The Quick Brown Fox      The Quick Brown Fox
153    
154  /the quick brown fox/IPi  /the quick brown fox/Pi
155      the quick brown fox      the quick brown fox
156      The Quick Brown Fox      The Quick Brown Fox
157    
158  /abc.def/IP  /abc.def/P
159      *** Failers      *** Failers
160      abc\ndef      abc\ndef
161    
162  /abc$/IP  /abc$/P
163      abc      abc
164      abc\n      abc\n
165    
166  /(abc)\2/IP  /(abc)\2/P
167    
168  /(abc\1)/IP  /(abc\1)/P
169      abc      abc
170    
171  /)/  /)/
# Line 236  Line 247 
247    
248  /((?i)blah)\s+\1/I  /((?i)blah)\s+\1/I
249    
250  /((?i)b)/IDS  /((?i)b)/IDZS
251    
252  /(a*b|(?i:c*(?-i)d))/IS  /(a*b|(?i:c*(?-i)d))/IS
253    
# Line 398  Line 409 
409    
410  /(?(1?)a|b)/  /(?(1?)a|b)/
411    
 /(?(1)a|b|c)/  
   
412  /[a[:xyz:/  /[a[:xyz:/
413    
414  /(?<=x+)y/  /(?<=x+)y/
# Line 440  Line 449 
449    
450  /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+  /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
451  )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+  )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
452  )?)?)?)?)?)?)?)?)?otherword/IM  )?)?)?)?)?)?)?)?)?otherword/I
453    
454  /.*X/ID  /.*X/IDZ
455    
456  /.*X/IDs  /.*X/IDZs
457    
458  /(.*X|^B)/ID  /(.*X|^B)/IDZ
459    
460  /(.*X|^B)/IDs  /(.*X|^B)/IDZs
461    
462  /(?s)(.*X|^B)/ID  /(?s)(.*X|^B)/IDZ
463    
464  /(?s:.*X|^B)/ID  /(?s:.*X|^B)/IDZ
465    
466  /\Biss\B/I+  /\Biss\B/I+
467      Mississippi      Mississippi
# Line 568  Line 577 
577    
578  /ab\d+/I  /ab\d+/I
579    
580  /a(?(1)b)/I  /a(?(1)b)(.)/I
581    
582  /a(?(1)bag|big)/I  /a(?(1)bag|big)(.)/I
583    
584  /a(?(1)bag|big)*/I  /a(?(1)bag|big)*(.)/I
585    
586  /a(?(1)bag|big)+/I  /a(?(1)bag|big)+(.)/I
587    
588  /a(?(1)b..|b..)/I  /a(?(1)b..|b..)(.)/I
589    
590  /ab\d{0}e/I  /ab\d{0}e/I
591    
# Line 595  Line 604 
604      *** Failers      *** Failers
605      \Nabc      \Nabc
606    
607  /a*(b+)(z)(z)/IP  /a*(b+)(z)(z)/P
608      aaaabbbbzzzz      aaaabbbbzzzz
609      aaaabbbbzzzz\O0      aaaabbbbzzzz\O0
610      aaaabbbbzzzz\O1      aaaabbbbzzzz\O1
# Line 666  Line 675 
675      (ab(cd)ef)      (ab(cd)ef)
676      (ab(cd(ef)gh)ij)      (ab(cd(ef)gh)ij)
677    
678  /^[[:alnum:]]/D  /^[[:alnum:]]/DZ
679    
680  /^[[:^alnum:]]/D  /^[[:^alnum:]]/DZ
681    
682  /^[[:alpha:]]/D  /^[[:alpha:]]/DZ
683    
684  /^[[:^alpha:]]/D  /^[[:^alpha:]]/DZ
685    
686  /[_[:alpha:]]/IS  /[_[:alpha:]]/IS
687    
688  /^[[:ascii:]]/D  /^[[:ascii:]]/DZ
689    
690  /^[[:^ascii:]]/D  /^[[:^ascii:]]/DZ
691    
692  /^[[:blank:]]/D  /^[[:blank:]]/DZ
693    
694  /^[[:^blank:]]/D  /^[[:^blank:]]/DZ
695    
696  /[\n\x0b\x0c\x0d[:blank:]]/IS  /[\n\x0b\x0c\x0d[:blank:]]/IS
697    
698  /^[[:cntrl:]]/D  /^[[:cntrl:]]/DZ
699    
700  /^[[:digit:]]/D  /^[[:digit:]]/DZ
701    
702  /^[[:graph:]]/D  /^[[:graph:]]/DZ
703    
704  /^[[:lower:]]/D  /^[[:lower:]]/DZ
705    
706  /^[[:print:]]/D  /^[[:print:]]/DZ
707    
708  /^[[:punct:]]/D  /^[[:punct:]]/DZ
709    
710  /^[[:space:]]/D  /^[[:space:]]/DZ
711    
712  /^[[:upper:]]/D  /^[[:upper:]]/DZ
713    
714  /^[[:xdigit:]]/D  /^[[:xdigit:]]/DZ
715    
716  /^[[:word:]]/D  /^[[:word:]]/DZ
717    
718  /^[[:^cntrl:]]/D  /^[[:^cntrl:]]/DZ
719    
720  /^[12[:^digit:]]/D  /^[12[:^digit:]]/DZ
721    
722  /^[[:^blank:]]/D  /^[[:^blank:]]/DZ
723    
724  /[01[:alpha:]%]/D  /[01[:alpha:]%]/DZ
725    
726  /[[.ch.]]/I  /[[.ch.]]/I
727    
# Line 796  Line 805 
805    
806  /--------------------------------------------------------------------/I  /--------------------------------------------------------------------/I
807    
808  /#/IxMD  /#/IxDZ
809    
810  /a#/IxMD  /a#/IxDZ
811    
812  /[\s]/D  /[\s]/DZ
813    
814  /[\S]/D  /[\S]/DZ
815    
816  /a(?i)b/D  /a(?i)b/DZ
817      ab      ab
818      aB      aB
819      *** Failers      *** Failers
820      AB      AB
821    
822  /(a(?i)b)/D  /(a(?i)b)/DZ
823      ab      ab
824      aB      aB
825      *** Failers      *** Failers
826      AB      AB
827    
828  /   (?i)abc/IxD  /   (?i)abc/IxDZ
829    
830  /#this is a comment  /#this is a comment
831    (?i)abc/IxD    (?i)abc/IxDZ
832    
833  /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D  /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
834    
835  /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D  /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
836    
837  /\Q\E/D  /\Q\E/DZ
838      \      \
839    
840  /\Q\Ex/D  /\Q\Ex/DZ
841    
842  / \Q\E/D  / \Q\E/DZ
843    
844  /a\Q\E/D  /a\Q\E/DZ
845    abc    abc
846    bca    bca
847    bac    bac
848    
849  /a\Q\Eb/D  /a\Q\Eb/DZ
850    abc    abc
851    
852  /\Q\Eabc/D  /\Q\Eabc/DZ
853    
854  /x*+\w/D  /x*+\w/DZ
855      *** Failers      *** Failers
856      xxxxx      xxxxx
857    
858  /x?+/D  /x?+/DZ
859    
860  /x++/D  /x++/DZ
861    
862  /x{1,3}+/D  /x{1,3}+/DZ
863    
864  /(x)*+/D  /(x)*+/DZ
865    
866  /^(\w++|\s++)*$/I  /^(\w++|\s++)*$/I
867      now is the time for all good men to come to the aid of the party      now is the time for all good men to come to the aid of the party
# Line 882  Line 891 
891      *** Failers      *** Failers
892      ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa      ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
893    
894  /(abc){1,3}+/D  /(abc){1,3}+/DZ
895    
896  /a+?+/I  /a+?+/I
897    
# Line 892  Line 901 
901    
902  /a{2,3}?+b/IU  /a{2,3}?+b/IU
903    
904  /x(?U)a++b/D  /x(?U)a++b/DZ
905      xaaaab      xaaaab
906    
907  /(?U)xa++b/D  /(?U)xa++b/DZ
908      xaaaab      xaaaab
909    
910  /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/D  /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/DZ
911    
912  /^x(?U)a+b/D  /^x(?U)a+b/DZ
913    
914  /^x(?U)(a+)b/D  /^x(?U)(a+)b/DZ
915    
916  /[.x.]/I  /[.x.]/I
917    
# Line 926  Line 935 
935    
936  /[[:space:]/I  /[[:space:]/I
937    
938  /[\s]/IDM  /[\s]/IDZ
939    
940  /[[:space:]]/IDM  /[[:space:]]/IDZ
941    
942  /[[:space:]abcde]/IDM  /[[:space:]abcde]/IDZ
943    
944  /< (?: (?(R) \d++  | [^<>]*+) | (?R)) * >/Ix  /< (?: (?(R) \d++  | [^<>]*+) | (?R)) * >/Ix
945      <>      <>
# Line 942  Line 951 
951      *** Failers      *** Failers
952      <abc      <abc
953    
954  |8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|IDM  |8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUK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'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|IDZ
957    
958  /(.*)\d+\1/I  /(.*)\d+\1/I
959    
# Line 977  Line 986 
986    
987  /()a/I  /()a/I
988    
989  /(?(1)ab|ac)/I  /(?(1)ab|ac)(.)/I
990    
991  /(?(1)abz|acz)/I  /(?(1)abz|acz)(.)/I
992    
993  /(?(1)abz)/I  /(?(1)abz)(.)/I
994    
995  /(?(1)abz)123/I  /(?(1)abz)(1)23/I
996    
997  /(a)+/I  /(a)+/I
998    
# Line 1120  Line 1129 
1129     >abc>1(2)3<xyz<     >abc>1(2)3<xyz<
1130     >abc>(1(2)3)<xyz<     >abc>(1(2)3)<xyz<
1131    
1132  /(a(?1)b)/D  /(a(?1)b)/DZ
   
 /(a(?1)+b)/D  
1133    
1134  /^\W*(?:((.)\W*(?1)\W*\2|)|((.)\W*(?3)\W*\4|\W*.\W*))\W*$/Ii  /(a(?1)+b)/DZ
     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  
1135    
1136  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
1137      12      12
# Line 1173  Line 1174 
1174      a=b      a=b
1175      a=bc      a=bc
1176    
1177  /a(?P<name1>b|c)d(?P<longername2>e)/D  /a(?P<name1>b|c)d(?P<longername2>e)/DZ
1178      abde      abde
1179      acde      acde
1180    
1181  /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/D  /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/DZ
1182    
1183  /(?P<a>a)...(?P=a)bbb(?P>a)d/D  /(?P<a>a)...(?P=a)bbb(?P>a)d/DZ
1184    
1185  /^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii  /^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii
1186      1221      1221
# Line 1215  Line 1216 
1216    
1217  /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is  /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
1218    
1219  /(a)(bc)/IND  /(a)(bc)/INDZ
1220    abc    abc
1221    
1222  /(?P<one>a)(bc)/IND  /(?P<one>a)(bc)/INDZ
1223    abc    abc
1224    
1225  /(a)(?P<named>bc)/IND  /(a)(?P<named>bc)/INDZ
1226    
1227  /(a+)*zz/I  /(a+)*zz/I
1228    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M
# Line 1239  Line 1240 
1240      abcdefgh\Cone\Ctwo      abcdefgh\Cone\Ctwo
1241      abcdefgh\Cthree      abcdefgh\Cthree
1242    
1243  /(?P<Tes>)(?P<Test>)/D  /(?P<Tes>)(?P<Test>)/DZ
1244    
1245  /(?P<Test>)(?P<Tes>)/D  /(?P<Test>)(?P<Tes>)/DZ
1246    
1247  /(?P<Z>zz)(?P<A>aa)/I  /(?P<Z>zz)(?P<A>aa)/I
1248      zzaa\CZ      zzaa\CZ
# Line 1260  Line 1261 
1261      [10,20,30,5,5,4,4,2,43,23,4234]      [10,20,30,5,5,4,4,2,43,23,4234]
1262      []      []
1263    
1264  /(a(b(?2)c))?/D  /(a(b(?2)c))?/DZ
1265    
1266  /(a(b(?2)c))*/D  /(a(b(?2)c))*/DZ
1267    
1268  /(a(b(?2)c)){0,2}/D  /(a(b(?2)c)){0,2}/DZ
1269    
1270  /[ab]{1}+/D  /[ab]{1}+/DZ
1271    
1272  /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii  /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
1273       Baby Bjorn Active Carrier - With free SHIPPING!!       Baby Bjorn Active Carrier - With free SHIPPING!!
# Line 1274  Line 1275 
1275  /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/IiS  /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/IiS
1276       Baby Bjorn Active Carrier - With free SHIPPING!!       Baby Bjorn Active Carrier - With free SHIPPING!!
1277    
1278  /a*.*b/ISD  /a*.*b/ISDZ
1279    
1280  /(a|b)*.?c/ISD  /(a|b)*.?c/ISDZ
1281    
1282  /abc(?C255)de(?C)f/D  /abc(?C255)de(?C)f/DZ
1283    
1284  /abcde/ICD  /abcde/ICDZ
1285    abcde    abcde
1286    abcdfe    abcdfe
1287    
1288  /a*b/ICD  /a*b/ICDZ
1289    ab    ab
1290    aaaab    aaaab
1291    aaaacb    aaaacb
1292    
1293  /a+b/ICD  /a+b/ICDZ
1294    ab    ab
1295    aaaab    aaaab
1296    aaaacb    aaaacb
1297    
1298  /(abc|def)x/ICD  /(abc|def)x/ICDZ
1299    abcx    abcx
1300    defx    defx
1301    abcdefzx    abcdefzx
# Line 1304  Line 1305 
1305    abcdabcd    abcdabcd
1306    abcdcdcdcdcd    abcdcdcdcdcd
1307    
1308  /([ab]{,4}c|xy)/ICD  /([ab]{,4}c|xy)/ICDZ
1309      Note: that { does NOT introduce a quantifier      Note: that { does NOT introduce a quantifier
1310    
1311  /([ab]{1,4}c|xy){4,5}?123/ICD  /([ab]{1,4}c|xy){4,5}?123/ICDZ
1312      aacaacaacaacaac123      aacaacaacaacaac123
1313    
1314  /\b.*/I  /\b.*/I
# Line 1421  Line 1422 
1422      ** Failers      ** Failers
1423      line one\nthis is a line\nbreak in the second line      line one\nthis is a line\nbreak in the second line
1424    
1425  /ab.cd/IP  /ab.cd/P
1426      ab-cd      ab-cd
1427      ab=cd      ab=cd
1428      ** Failers      ** Failers
1429      ab\ncd      ab\ncd
1430    
1431  /ab.cd/IPs  /ab.cd/Ps
1432      ab-cd      ab-cd
1433      ab=cd      ab=cd
1434      ab\ncd      ab\ncd
# Line 1482  Line 1483 
1483      (this)      (this)
1484      ((this))      ((this))
1485    
1486  /a(b)c/IPN  /a(b)c/PN
1487      abc      abc
1488    
1489  /a(?P<name>b)c/IPN  /a(?P<name>b)c/PN
1490      abc      abc
1491    
1492  /\x{100}/I  /\x{100}/I
# Line 1667  a random value. /Ix Line 1668  a random value. /Ix
1668    
1669  /(d?|c)[ab]xyz/IS  /(d?|c)[ab]xyz/IS
1670    
1671  /^a*b\d/D  /^a*b\d/DZ
1672    
1673  /^a*+b\d/D  /^a*+b\d/DZ
1674    
1675  /^a*?b\d/D  /^a*?b\d/DZ
1676    
1677  /^a+A\d/D  /^a+A\d/DZ
1678      aaaA5      aaaA5
1679      ** Failers      ** Failers
1680      aaaa5      aaaa5
1681    
1682  /^a*A\d/IiD  /^a*A\d/IiDZ
1683      aaaA5      aaaA5
1684      aaaa5      aaaa5
1685    
# Line 1700  a random value. /Ix Line 1701  a random value. /Ix
1701  /Ix  /Ix
1702    large nest    large nest
1703    
1704  /a*\d/B  /a*\d/BZ
1705    
1706  /a*\D/B  /a*\D/BZ
1707    
1708  /0*\d/B  /0*\d/BZ
1709    
1710  /0*\D/B  /0*\D/BZ
1711    
1712  /a*\s/B  /a*\s/BZ
1713    
1714  /a*\S/B  /a*\S/BZ
1715    
1716  / *\s/B  / *\s/BZ
1717    
1718  / *\S/B  / *\S/BZ
1719    
1720  /a*\w/B  /a*\w/BZ
1721    
1722  /a*\W/B  /a*\W/BZ
1723    
1724  /=*\w/B  /=*\w/BZ
1725    
1726  /=*\W/B  /=*\W/BZ
1727    
1728  /\d*a/B  /\d*a/BZ
1729    
1730  /\d*2/B  /\d*2/BZ
1731    
1732  /\d*\d/B  /\d*\d/BZ
1733    
1734  /\d*\D/B  /\d*\D/BZ
1735    
1736  /\d*\s/B  /\d*\s/BZ
1737    
1738  /\d*\S/B  /\d*\S/BZ
1739    
1740  /\d*\w/B  /\d*\w/BZ
1741    
1742  /\d*\W/B  /\d*\W/BZ
1743    
1744  /\D*a/B  /\D*a/BZ
1745    
1746  /\D*2/B  /\D*2/BZ
1747    
1748  /\D*\d/B  /\D*\d/BZ
1749    
1750  /\D*\D/B  /\D*\D/BZ
1751    
1752  /\D*\s/B  /\D*\s/BZ
1753    
1754  /\D*\S/B  /\D*\S/BZ
1755    
1756  /\D*\w/B  /\D*\w/BZ
1757    
1758  /\D*\W/B  /\D*\W/BZ
1759    
1760  /\s*a/B  /\s*a/BZ
1761    
1762  /\s*2/B  /\s*2/BZ
1763    
1764  /\s*\d/B  /\s*\d/BZ
1765    
1766  /\s*\D/B  /\s*\D/BZ
1767    
1768  /\s*\s/B  /\s*\s/BZ
1769    
1770  /\s*\S/B  /\s*\S/BZ
1771    
1772  /\s*\w/B  /\s*\w/BZ
1773    
1774  /\s*\W/B  /\s*\W/BZ
1775    
1776  /\S*a/B  /\S*a/BZ
1777    
1778  /\S*2/B  /\S*2/BZ
1779    
1780  /\S*\d/B  /\S*\d/BZ
1781    
1782  /\S*\D/B  /\S*\D/BZ
1783    
1784  /\S*\s/B  /\S*\s/BZ
1785    
1786  /\S*\S/B  /\S*\S/BZ
1787    
1788  /\S*\w/B  /\S*\w/BZ
1789    
1790  /\S*\W/B  /\S*\W/BZ
1791    
1792  /\w*a/B  /\w*a/BZ
1793    
1794  /\w*2/B  /\w*2/BZ
1795    
1796  /\w*\d/B  /\w*\d/BZ
1797    
1798  /\w*\D/B  /\w*\D/BZ
1799    
1800  /\w*\s/B  /\w*\s/BZ
1801    
1802  /\w*\S/B  /\w*\S/BZ
1803    
1804  /\w*\w/B  /\w*\w/BZ
1805    
1806  /\w*\W/B  /\w*\W/BZ
1807    
1808  /\W*a/B  /\W*a/BZ
1809    
1810  /\W*2/B  /\W*2/BZ
1811    
1812  /\W*\d/B  /\W*\d/BZ
1813    
1814  /\W*\D/B  /\W*\D/BZ
1815    
1816  /\W*\s/B  /\W*\s/BZ
1817    
1818  /\W*\S/B  /\W*\S/BZ
1819    
1820  /\W*\w/B  /\W*\w/BZ
1821    
1822  /\W*\W/B  /\W*\W/BZ
1823    
1824  /[^a]+a/B  /[^a]+a/BZ
1825    
1826  /[^a]+a/Bi  /[^a]+a/BZi
1827    
1828  /[^a]+A/Bi  /[^a]+A/BZi
1829    
1830  /[^a]+b/B  /[^a]+b/BZ
1831    
1832  /[^a]+\d/B  /[^a]+\d/BZ
1833    
1834  /a*[^a]/B  /a*[^a]/BZ
1835    
1836  /(?P<abc>x)(?P<xyz>y)/I  /(?P<abc>x)(?P<xyz>y)/I
1837      xy\Cabc\Cxyz      xy\Cabc\Cxyz
# Line 1885  a random value. /Ix Line 1886  a random value. /Ix
1886      Xaaa      Xaaa
1887      Xaba      Xaba
1888    
1889  /^[\E\Qa\E-\Qz\E]+/B  /^[\E\Qa\E-\Qz\E]+/BZ
1890    
1891  /^[a\Q]bc\E]/B  /^[a\Q]bc\E]/BZ
1892    
1893  /^[a-\Q\E]/B  /^[a-\Q\E]/BZ
1894    
1895  /^(?P>abc)[()](?<abc>)/B  /^(?P>abc)[()](?<abc>)/BZ
1896    
1897  /^((?(abc)y)[()](?P<abc>x))+/B  /^((?(abc)y)[()](?P<abc>x))+/BZ
1898      (xy)x      (xy)x
1899    
1900  /^(?P>abc)\Q()\E(?<abc>)/B  /^(?P>abc)\Q()\E(?<abc>)/BZ
1901    
1902  /^(?P>abc)[a\Q(]\E(](?<abc>)/B  /^(?P>abc)[a\Q(]\E(](?<abc>)/BZ
1903    
1904  /^(?P>abc) # this is (a comment)  /^(?P>abc) # this is (a comment)
1905    (?<abc>)/Bx    (?<abc>)/BZx
1906    
1907  /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii  /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
1908      1221      1221
# Line 1917  a random value. /Ix Line 1918  a random value. /Ix
1918  /(?=(?'abc'\w+))\k<abc>:/I  /(?=(?'abc'\w+))\k<abc>:/I
1919      abcd:      abcd:
1920    
 /(?'abc'\w+):\k<abc>{2}/  
     a:aaxyz  
     ab:ababxyz  
     ** Failers  
     a:axyz  
     ab:abxyz  
   
1921  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
1922      adaa      adaa
1923      ** Failers      ** Failers
# Line 1936  a random value. /Ix Line 1930  a random value. /Ix
1930      ** Failers      ** Failers
1931      bddd      bddd
1932    
 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x  
     abd  
     ce  
   
1933  /(?(<bc))/  /(?(<bc))/
1934    
1935  /(?(''))/  /(?(''))/
# Line 1957  a random value. /Ix Line 1947  a random value. /Ix
1947  /(?<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
1948      abcabc1Xabc2XabcXabcabc      abcabc1Xabc2XabcXabcabc
1949    
 /^(?(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  
   
1950  /^(?(DEFINE) abc | xyz ) /x  /^(?(DEFINE) abc | xyz ) /x
1951    
1952  /(?(DEFINE) abc) xyz/xI  /(?(DEFINE) abc) xyz/xI
# Line 1980  a random value. /Ix Line 1960  a random value. /Ix
1960  /^a.b/<lf>  /^a.b/<lf>
1961      a\rb      a\rb
1962      a\nb\<cr>      a\nb\<cr>
1963        a\x85b\<anycrlf>
1964      ** Failers      ** Failers
1965      a\nb      a\nb
1966      a\nb\<any>      a\nb\<any>
1967      a\rb\<cr>      a\rb\<cr>
1968      a\rb\<any>      a\rb\<any>
1969        a\x85b\<any>
1970        a\rb\<anycrlf>
1971    
1972  /^abc./mgx<any>  /^abc./mgx<any>
1973      abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK      abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
1974    
1975  /abc.$/mgx<any>  /abc.$/mgx<any>
1976      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
1977    
1978  /a/<cr><any>  /a/<cr><any>
1979    
1980  /a/<any><crlf>  /a/<any><crlf>
1981    
1982  /^a\Rb/  /^a\Rb/<bsr_unicode>
1983      a\nb      a\nb
1984      a\rb      a\rb
1985      a\r\nb      a\r\nb
# Line 2006  a random value. /Ix Line 1989  a random value. /Ix
1989      ** Failers      ** Failers
1990      a\n\rb      a\n\rb
1991    
1992  /^a\R*b/  /^a\R*b/<bsr_unicode>
1993      ab      ab
1994      a\nb      a\nb
1995      a\rb      a\rb
# Line 2017  a random value. /Ix Line 2000  a random value. /Ix
2000      a\n\rb      a\n\rb
2001      a\n\r\x85\x0cb      a\n\r\x85\x0cb
2002    
2003  /^a\R+b/  /^a\R+b/<bsr_unicode>
2004      a\nb      a\nb
2005      a\rb      a\rb
2006      a\r\nb      a\r\nb
# Line 2029  a random value. /Ix Line 2012  a random value. /Ix
2012      ** Failers      ** Failers
2013      ab      ab
2014    
2015  /^a\R{1,3}b/  /^a\R{1,3}b/<bsr_unicode>
2016      a\nb      a\nb
2017      a\n\rb      a\n\rb
2018      a\n\r\x85b      a\n\r\x85b
# Line 2041  a random value. /Ix Line 2024  a random value. /Ix
2024      a\n\n\n\rb      a\n\n\n\rb
2025      a\r      a\r
2026    
2027  /^a[\R]b/  /^a[\R]b/<bsr_unicode>
2028      aRb      aRb
2029      ** Failers      ** Failers
2030      a\nb      a\nb
# Line 2052  a random value. /Ix Line 2035  a random value. /Ix
2035  /(?1)X(?<abc>P)/I  /(?1)X(?<abc>P)/I
2036      abcPXP123      abcPXP123
2037    
 /(?(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  
   
2038  /(?:a(?&abc)b)*(?<abc>x)/  /(?:a(?&abc)b)*(?<abc>x)/
2039      123axbaxbaxbx456      123axbaxbaxbx456
2040      123axbaxbaxb456      123axbaxbaxb456
# Line 2089  a random value. /Ix Line 2056  a random value. /Ix
2056     defabcabcxyz     defabcabcxyz
2057     DEFabcABCXYZ     DEFabcABCXYZ
2058    
 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/  
     ababababbbabZXXXX  
   
2059  /^(a)\g-2/  /^(a)\g-2/
2060    
2061  /^(a)\g/  /^(a)\g/
# Line 2145  a random value. /Ix Line 2109  a random value. /Ix
2109  /(?m)$/<any>g+  /(?m)$/<any>g+
2110      abc\r\n\r\n      abc\r\n\r\n
2111    
2112  / End of testinput2 /  /abc.$/mgx<anycrlf>
2113        abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
2114    
2115    /^X/m
2116        XABC
2117        ** Failers
2118        XABC\B
2119    
2120    /(ab|c)(?-1)/BZ
2121        abc
2122    
2123    /xy(?+1)(abc)/BZ
2124        xyabcabc
2125        ** Failers
2126        xyabc
2127    
2128    /x(?-0)y/
2129    
2130    /x(?-1)y/
2131    
2132    /x(?+0)y/
2133    
2134    /x(?+1)y/
2135    
2136    /^(abc)?(?(-1)X|Y)/BZ
2137        abcX
2138        Y
2139        ** Failers
2140        abcY
2141    
2142    /^((?(+1)X|Y)(abc))+/BZ
2143        YabcXabc
2144        YabcXabcXabc
2145        ** Failers
2146        XabcXabc
2147    
2148    /(?(-1)a)/BZ
2149    
2150    /((?(-1)a))/BZ
2151    
2152    /((?(-2)a))/BZ
2153    
2154    /^(?(+1)X|Y)(.)/BZ
2155        Y!
2156    
2157    /(?<A>tom|bon)-\k{A}/
2158        tom-tom
2159        bon-bon
2160        ** Failers
2161        tom-bon
2162    
2163    /\g{A/
2164    
2165    /(?|(abc)|(xyz))/BZ
2166       >abc<
2167       >xyz<
2168    
2169    /(x)(?|(abc)|(xyz))(x)/BZ
2170        xabcx
2171        xxyzx
2172    
2173    /(x)(?|(abc)(pqr)|(xyz))(x)/BZ
2174        xabcpqrx
2175        xxyzx
2176    
2177    /[\h]/BZ
2178        >\x09<
2179    
2180    /[\h]+/BZ
2181        >\x09\x20\xa0<
2182    
2183    /[\v]/BZ
2184    
2185    /[\H]/BZ
2186    
2187    /[^\h]/BZ
2188    
2189    /[\V]/BZ
2190    
2191    /[\x0a\V]/BZ
2192    
2193    /\H++X/BZ
2194        ** Failers
2195        XXXX
2196    
2197    /\H+\hY/BZ
2198        XXXX Y
2199    
2200    /\H+ Y/BZ
2201    
2202    /\h+A/BZ
2203    
2204    /\v*B/BZ
2205    
2206    /\V+\x0a/BZ
2207    
2208    /A+\h/BZ
2209    
2210    / *\H/BZ
2211    
2212    /A*\v/BZ
2213    
2214    /\x0b*\V/BZ
2215    
2216    /\d+\h/BZ
2217    
2218    /\d*\v/BZ
2219    
2220    /S+\h\S+\v/BZ
2221    
2222    /\w{3,}\h\w+\v/BZ
2223    
2224    /\h+\d\h+\w\h+\S\h+\H/BZ
2225    
2226    /\v+\d\v+\w\v+\S\v+\V/BZ
2227    
2228    /\H+\h\H+\d/BZ
2229    
2230    /\V+\v\V+\w/BZ
2231    
2232    /\( (?: [^()]* | (?R) )* \)/x
2233    (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(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)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)
2234    
2235    /[\E]AAA/
2236    
2237    /[\Q\E]AAA/
2238    
2239    /[^\E]AAA/
2240    
2241    /[^\Q\E]AAA/
2242    
2243    /[\E^]AAA/
2244    
2245    /[\Q\E^]AAA/
2246    
2247    /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/BZ
2248    
2249    /^a+(*FAIL)/C
2250        aaaaaa
2251    
2252    /a+b?c+(*FAIL)/C
2253        aaabccc
2254    
2255    /a+b?(*PRUNE)c+(*FAIL)/C
2256        aaabccc
2257    
2258    /a+b?(*COMMIT)c+(*FAIL)/C
2259        aaabccc
2260    
2261    /a+b?(*SKIP)c+(*FAIL)/C
2262        aaabcccaaabccc
2263    
2264    /a+b?(*THEN)c+(*FAIL)/C
2265        aaabccc
2266    
2267    /a(*PRUNE:XXX)b/
2268    
2269    /a(*MARK)b/
2270    
2271    /(?i:A{1,}\6666666666)/
2272    
2273    /\g6666666666/
2274    
2275    /[\g6666666666]/
2276    
2277    /(?1)\c[/
2278    
2279    /.+A/<crlf>
2280        \r\nA
2281    
2282    /\nA/<crlf>
2283        \r\nA
2284    
2285    /[\r\n]A/<crlf>
2286        \r\nA
2287    
2288    /(\r|\n)A/<crlf>
2289        \r\nA
2290    
2291    /a(*CR)b/
2292    
2293    /(*CR)a.b/
2294        a\nb
2295        ** Failers
2296        a\rb
2297    
2298    /(*CR)a.b/<lf>
2299        a\nb
2300        ** Failers
2301        a\rb
2302    
2303    /(*LF)a.b/<CRLF>
2304        a\rb
2305        ** Failers
2306        a\nb
2307    
2308    /(*CRLF)a.b/
2309        a\rb
2310        a\nb
2311        ** Failers
2312        a\r\nb
2313    
2314    /(*ANYCRLF)a.b/<CR>
2315        ** Failers
2316        a\rb
2317        a\nb
2318        a\r\nb
2319    
2320    /(*ANY)a.b/<cr>
2321        ** Failers
2322        a\rb
2323        a\nb
2324        a\r\nb
2325        a\x85b
2326    
2327    /a\Rb/I<bsr_anycrlf>
2328        a\rb
2329        a\nb
2330        a\r\nb
2331        ** Failers
2332        a\x85b
2333        a\x0bb
2334    
2335    /a\Rb/I<bsr_unicode>
2336        a\rb
2337        a\nb
2338        a\r\nb
2339        a\x85b
2340        a\x0bb
2341        ** Failers
2342        a\x85b\<bsr_anycrlf>
2343        a\x0bb\<bsr_anycrlf>
2344    
2345    /a\R?b/I<bsr_anycrlf>
2346        a\rb
2347        a\nb
2348        a\r\nb
2349        ** Failers
2350        a\x85b
2351        a\x0bb
2352    
2353    /a\R?b/I<bsr_unicode>
2354        a\rb
2355        a\nb
2356        a\r\nb
2357        a\x85b
2358        a\x0bb
2359        ** Failers
2360        a\x85b\<bsr_anycrlf>
2361        a\x0bb\<bsr_anycrlf>
2362    
2363    /a\R{2,4}b/I<bsr_anycrlf>
2364        a\r\n\nb
2365        a\n\r\rb
2366        a\r\n\r\n\r\n\r\nb
2367        ** Failers
2368        a\x85\85b
2369        a\x0b\0bb
2370    
2371    /a\R{2,4}b/I<bsr_unicode>
2372        a\r\rb
2373        a\n\n\nb
2374        a\r\n\n\r\rb
2375        a\x85\85b
2376        a\x0b\0bb
2377        ** Failers
2378        a\r\r\r\r\rb
2379        a\x85\85b\<bsr_anycrlf>
2380        a\x0b\0bb\<bsr_anycrlf>
2381    
2382    /(*BSR_ANYCRLF)a\Rb/I
2383        a\nb
2384        a\rb
2385    
2386    /(*BSR_UNICODE)a\Rb/I
2387        a\x85b
2388    
2389    /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
2390        a\nb
2391        a\rb
2392    
2393    /(*CRLF)(*BSR_UNICODE)a\Rb/I
2394        a\x85b
2395    
2396    /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
2397    
2398    /(?<a>)(?&)/
2399    
2400    /(?<abc>)(?&a)/
2401    
2402    /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
2403    
2404    /(?+-a)/
2405    
2406    /(?-+a)/
2407    
2408    /(?(-1))/
2409    
2410    /(?(+10))/
2411    
2412    /(?(10))/
2413    
2414    /(?(+2))()()/
2415    
2416    /(?(2))()()/
2417    
2418    /\k''/
2419    
2420    /\k<>/
2421    
2422    /\k{}/
2423    
2424    /(?P=)/
2425    
2426    /(?P>)/
2427    
2428    /(?!\w)(?R)/
2429    
2430    /(?=\w)(?R)/
2431    
2432    /(?<!\w)(?R)/
2433    
2434    /(?<=\w)(?R)/
2435    
2436    /[[:foo:]]/
2437    
2438    /[[:1234:]]/
2439    
2440    /[[:f\oo:]]/
2441    
2442    /[[: :]]/
2443    
2444    /[[:...:]]/
2445    
2446    /[[:l\ower:]]/
2447    
2448    /[[:abc\:]]/
2449    
2450    /[abc[:x\]pqr:]]/
2451    
2452    /[[:a\dz:]]/
2453    
2454    /(^(a|b\g<-1'c))/
2455    
2456    /^(?+1)(?<a>x|y){0}z/
2457        xzxx
2458        yzyy
2459        ** Failers
2460        xxz
2461    
2462    /(\3)(\1)(a)/
2463        cat
2464    
2465    /(\3)(\1)(a)/<JS>
2466        cat
2467    
2468    /TA]/
2469        The ACTA] comes
2470    
2471    /TA]/<JS>
2472        The ACTA] comes
2473    
2474    /(?2)[]a()b](abc)/
2475        abcbabc
2476    
2477    /(?2)[^]a()b](abc)/
2478        abcbabc
2479    
2480    /(?1)[]a()b](abc)/
2481        abcbabc
2482        ** Failers
2483        abcXabc
2484    
2485    /(?1)[^]a()b](abc)/
2486        abcXabc
2487        ** Failers
2488        abcbabc
2489    
2490    /(?2)[]a()b](abc)(xyz)/
2491        xyzbabcxyz
2492    
2493    /(?&N)[]a(?<N>)](?<M>abc)/
2494       abc<abc
2495    
2496    /(?&N)[]a(?<N>)](abc)/
2497       abc<abc
2498    
2499    /a[]b/
2500    
2501    /a[^]b/
2502    
2503    /a[]b/<JS>
2504        ** Failers
2505        ab
2506    
2507    /a[]+b/<JS>
2508        ** Failers
2509        ab
2510    
2511    /a[]*+b/<JS>
2512        ** Failers
2513        ab
2514    
2515    /a[^]b/<JS>
2516        aXb
2517        a\nb
2518        ** Failers
2519        ab
2520    
2521    /a[^]+b/<JS>
2522        aXb
2523        a\nX\nXb
2524        ** Failers
2525        ab
2526    
2527    /a(?!)+b/
2528    
2529    /a(*FAIL)+b/
2530    
2531    /(abc|pqr|123){0}[xyz]/SI
2532    
2533    /(?(?=.*b)b|^)/CI
2534       adc
2535       abc
2536    
2537    /(?(?=b).*b|^d)/I
2538    
2539    /(?(?=.*b).*b|^d)/I
2540    
2541    /a?|b?/P
2542        abc
2543        ** Failers
2544        ddd\N
2545    
2546    /xyz/C
2547      xyz
2548      abcxyz
2549      abcxyz\Y
2550      ** Failers
2551      abc
2552      abc\Y
2553      abcxypqr
2554      abcxypqr\Y
2555    
2556    /^"((?(?=[a])[^"])|b)*"$/C
2557        "ab"
2558    
2559    /^"((?(?=[a])[^"])|b)*"$/
2560        "ab"
2561    
2562    /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
2563        XYabcdY
2564    
2565    /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
2566        XYabcdY
2567    
2568    /Xa{2,4}b/
2569        X\P
2570        Xa\P
2571        Xaa\P
2572        Xaaa\P
2573        Xaaaa\P
2574    
2575    /Xa{2,4}?b/
2576        X\P
2577        Xa\P
2578        Xaa\P
2579        Xaaa\P
2580        Xaaaa\P
2581    
2582    /Xa{2,4}+b/
2583        X\P
2584        Xa\P
2585        Xaa\P
2586        Xaaa\P
2587        Xaaaa\P
2588    
2589    /X\d{2,4}b/
2590        X\P
2591        X3\P
2592        X33\P
2593        X333\P
2594        X3333\P
2595    
2596    /X\d{2,4}?b/
2597        X\P
2598        X3\P
2599        X33\P
2600        X333\P
2601        X3333\P
2602    
2603    /X\d{2,4}+b/
2604        X\P
2605        X3\P
2606        X33\P
2607        X333\P
2608        X3333\P
2609    
2610    /X\D{2,4}b/
2611        X\P
2612        Xa\P
2613        Xaa\P
2614        Xaaa\P
2615        Xaaaa\P
2616    
2617    /X\D{2,4}?b/
2618        X\P
2619        Xa\P
2620        Xaa\P
2621        Xaaa\P
2622        Xaaaa\P
2623    
2624    /X\D{2,4}+b/
2625        X\P
2626        Xa\P
2627        Xaa\P
2628        Xaaa\P
2629        Xaaaa\P
2630    
2631    /X[abc]{2,4}b/
2632        X\P
2633        Xa\P
2634        Xaa\P
2635        Xaaa\P
2636        Xaaaa\P
2637    
2638    /X[abc]{2,4}?b/
2639        X\P
2640        Xa\P
2641        Xaa\P
2642        Xaaa\P
2643        Xaaaa\P
2644    
2645    /X[abc]{2,4}+b/
2646        X\P
2647        Xa\P
2648        Xaa\P
2649        Xaaa\P
2650        Xaaaa\P
2651    
2652    /X[^a]{2,4}b/
2653        X\P
2654        Xz\P
2655        Xzz\P
2656        Xzzz\P
2657        Xzzzz\P
2658    
2659    /X[^a]{2,4}?b/
2660        X\P
2661        Xz\P
2662        Xzz\P
2663        Xzzz\P
2664        Xzzzz\P
2665    
2666    /X[^a]{2,4}+b/
2667        X\P
2668        Xz\P
2669        Xzz\P
2670        Xzzz\P
2671        Xzzzz\P
2672    
2673    /(Y)X\1{2,4}b/
2674        YX\P
2675        YXY\P
2676        YXYY\P
2677        YXYYY\P
2678        YXYYYY\P
2679    
2680    /(Y)X\1{2,4}?b/
2681        YX\P
2682        YXY\P
2683        YXYY\P
2684        YXYYY\P
2685        YXYYYY\P
2686    
2687    /(Y)X\1{2,4}+b/
2688        YX\P
2689        YXY\P
2690        YXYY\P
2691        YXYYY\P
2692        YXYYYY\P
2693    
2694    /\++\KZ|\d+X|9+Y/
2695        ++++123999\P
2696        ++++123999Y\P
2697        ++++Z1234\P
2698    
2699    /Z(*F)/
2700        Z\P
2701        ZA\P
2702    
2703    /Z(?!)/
2704        Z\P
2705        ZA\P
2706    
2707    /dog(sbody)?/
2708        dogs\P
2709        dogs\P\P
2710    
2711    /dog(sbody)??/
2712        dogs\P
2713        dogs\P\P
2714    
2715    /dog|dogsbody/
2716        dogs\P
2717        dogs\P\P
2718    
2719    /dogsbody|dog/
2720        dogs\P
2721        dogs\P\P
2722    
2723    /\bthe cat\b/
2724        the cat\P
2725        the cat\P\P
2726    
2727    /abc/
2728       abc\P
2729       abc\P\P
2730    
2731    /\w+A/P
2732       CDAAAAB
2733    
2734    /\w+A/PU
2735       CDAAAAB
2736    
2737    /abc\K123/
2738        xyzabc123pqr
2739        xyzabc12\P
2740        xyzabc12\P\P
2741    
2742    /(?<=abc)123/
2743        xyzabc123pqr
2744        xyzabc12\P
2745        xyzabc12\P\P
2746    
2747    /\babc\b/
2748        +++abc+++
2749        +++ab\P
2750        +++ab\P\P
2751    
2752    /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
2753    
2754    /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
2755    
2756    /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
2757    
2758    /abc\K/+
2759        abcdef
2760        abcdef\N\N
2761        xyzabcdef\N\N
2762        ** Failers
2763        abcdef\N
2764        xyzabcdef\N
2765    
2766    /^(?:(?=abc)|abc\K)/+
2767        abcdef
2768        abcdef\N\N
2769        ** Failers
2770        abcdef\N
2771    
2772    /a?b?/+
2773        xyz
2774        xyzabc
2775        xyzabc\N
2776        xyzabc\N\N
2777        xyz\N\N
2778        ** Failers
2779        xyz\N
2780    
2781    /^a?b?/+
2782        xyz
2783        xyzabc
2784        ** Failers
2785        xyzabc\N
2786        xyzabc\N\N
2787        xyz\N\N
2788        xyz\N
2789    
2790    /^(?<name>a|b\g<name>c)/
2791        aaaa
2792        bacxxx
2793        bbaccxxx
2794        bbbacccxx
2795    
2796    /^(?<name>a|b\g'name'c)/
2797        aaaa
2798        bacxxx
2799        bbaccxxx
2800        bbbacccxx
2801    
2802    /^(a|b\g<1>c)/
2803        aaaa
2804        bacxxx
2805        bbaccxxx
2806        bbbacccxx
2807    
2808    /^(a|b\g'1'c)/
2809        aaaa
2810        bacxxx
2811        bbaccxxx
2812        bbbacccxx
2813    
2814    /^(a|b\g'-1'c)/
2815        aaaa
2816        bacxxx
2817        bbaccxxx
2818        bbbacccxx
2819    
2820    /(^(a|b\g<-1>c))/
2821        aaaa
2822        bacxxx
2823        bbaccxxx
2824        bbbacccxx
2825    
2826    /(?-i:\g<name>)(?i:(?<name>a))/
2827        XaaX
2828        XAAX
2829    
2830    /(?i:\g<name>)(?-i:(?<name>a))/
2831        XaaX
2832        ** Failers
2833        XAAX
2834    
2835    /(?-i:\g<+1>)(?i:(a))/
2836        XaaX
2837        XAAX
2838    
2839    /(?=(?<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>\})\}))\{/
2840    
2841    /(?<n>a|b|c)\g<n>*/
2842       abc
2843       accccbbb
2844    
2845    /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
2846        XYabcdY
2847    
2848    /(?<=b(?1)|zzz)(a)/
2849        xbaax
2850        xzzzax
2851    
2852    /(a)(?<=b\1)/
2853    
2854    /(a)(?<=b+(?1))/
2855    
2856    /(a+)(?<=b(?1))/
2857    
2858    /(a(?<=b(?1)))/
2859    
2860    /(?<=b(?1))xyz/
2861    
2862    /(?<=b(?1))xyz(b+)pqrstuvew/
2863    
2864    /(a|bc)\1/SI
2865    
2866    /(a|bc)\1{2,3}/SI
2867    
2868    /(a|bc)(?1)/SI
2869    
2870    /(a|b\1)(a|b\1)/SI
2871    
2872    /(a|b\1){2}/SI
2873    
2874    /(a|bbbb\1)(a|bbbb\1)/SI
2875    
2876    /(a|bbbb\1){2}/SI
2877    
2878    /^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
2879    
2880    /  (?: [\040\t] |  \(
2881    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2882    \)  )*                          # optional leading comment
2883    (?:    (?:
2884    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
2885    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2886    |
2887    " (?:                      # opening quote...
2888    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
2889    |                     #    or
2890    \\ [^\x80-\xff]           #   Escaped something (something != CR)
2891    )* "  # closing quote
2892    )                    # initial word
2893    (?:  (?: [\040\t] |  \(
2894    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2895    \)  )*  \.  (?: [\040\t] |  \(
2896    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2897    \)  )*   (?:
2898    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
2899    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2900    |
2901    " (?:                      # opening quote...
2902    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
2903    |                     #    or
2904    \\ [^\x80-\xff]           #   Escaped something (something != CR)
2905    )* "  # closing quote
2906    )  )* # further okay, if led by a period
2907    (?: [\040\t] |  \(
2908    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2909    \)  )*  @  (?: [\040\t] |  \(
2910    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2911    \)  )*    (?:
2912    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
2913    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2914    |   \[                         # [
2915    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
2916    \]                        #           ]
2917    )                           # initial subdomain
2918    (?:                                  #
2919    (?: [\040\t] |  \(
2920    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2921    \)  )*  \.                        # if led by a period...
2922    (?: [\040\t] |  \(
2923    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2924    \)  )*   (?:
2925    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
2926    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2927    |   \[                         # [
2928    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
2929    \]                        #           ]
2930    )                     #   ...further okay
2931    )*
2932    # address
2933    |                     #  or
2934    (?:
2935    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
2936    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2937    |
2938    " (?:                      # opening quote...
2939    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
2940    |                     #    or
2941    \\ [^\x80-\xff]           #   Escaped something (something != CR)
2942    )* "  # closing quote
2943    )             # one word, optionally followed by....
2944    (?:
2945    [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]  |  # atom and space parts, or...
2946    \(
2947    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2948    \)       |  # comments, or...
2949    
2950    " (?:                      # opening quote...
2951    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
2952    |                     #    or
2953    \\ [^\x80-\xff]           #   Escaped something (something != CR)
2954    )* "  # closing quote
2955    # quoted strings
2956    )*
2957    <  (?: [\040\t] |  \(
2958    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2959    \)  )*                     # leading <
2960    (?:  @  (?: [\040\t] |  \(
2961    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2962    \)  )*    (?:
2963    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
2964    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2965    |   \[                         # [
2966    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
2967    \]                        #           ]
2968    )                           # initial subdomain
2969    (?:                                  #
2970    (?: [\040\t] |  \(
2971    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2972    \)  )*  \.                        # if led by a period...
2973    (?: [\040\t] |  \(
2974    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2975    \)  )*   (?:
2976    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
2977    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2978    |   \[                         # [
2979    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
2980    \]                        #           ]
2981    )                     #   ...further okay
2982    )*
2983    
2984    (?:  (?: [\040\t] |  \(
2985    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
2986    \)  )*  ,  (?: [\040\t] |  \(
2987    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
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    )                           # initial subdomain
2997    (?:                                  #
2998    (?: [\040\t] |  \(
2999    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3000    \)  )*  \.                        # if led by a period...
3001    (?: [\040\t] |  \(
3002    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3003    \)  )*   (?:
3004    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
3005    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3006    |   \[                         # [
3007    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
3008    \]                        #           ]
3009    )                     #   ...further okay
3010    )*
3011    )* # further okay, if led by comma
3012    :                                # closing colon
3013    (?: [\040\t] |  \(
3014    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3015    \)  )*  )? #       optional route
3016    (?:
3017    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
3018    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3019    |
3020    " (?:                      # opening quote...
3021    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
3022    |                     #    or
3023    \\ [^\x80-\xff]           #   Escaped something (something != CR)
3024    )* "  # closing quote
3025    )                    # initial word
3026    (?:  (?: [\040\t] |  \(
3027    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3028    \)  )*  \.  (?: [\040\t] |  \(
3029    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3030    \)  )*   (?:
3031    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
3032    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3033    |
3034    " (?:                      # opening quote...
3035    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
3036    |                     #    or
3037    \\ [^\x80-\xff]           #   Escaped something (something != CR)
3038    )* "  # closing quote
3039    )  )* # further okay, if led by a period
3040    (?: [\040\t] |  \(
3041    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3042    \)  )*  @  (?: [\040\t] |  \(
3043    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3044    \)  )*    (?:
3045    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
3046    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3047    |   \[                         # [
3048    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
3049    \]                        #           ]
3050    )                           # initial subdomain
3051    (?:                                  #
3052    (?: [\040\t] |  \(
3053    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3054    \)  )*  \.                        # if led by a period...
3055    (?: [\040\t] |  \(
3056    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3057    \)  )*   (?:
3058    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
3059    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3060    |   \[                         # [
3061    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
3062    \]                        #           ]
3063    )                     #   ...further okay
3064    )*
3065    #       address spec
3066    (?: [\040\t] |  \(
3067    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3068    \)  )*  > #                  trailing >
3069    # name and address
3070    )  (?: [\040\t] |  \(
3071    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
3072    \)  )*                       # optional trailing comment
3073    /xSI
3074    
3075    /<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
3076    
3077    "(?>.*/)foo"SI
3078    
3079    /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /xSI
3080    
3081    /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
3082    
3083    /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
3084    
3085    /<a[\s]+href[\s]*=[\s]*          # find <a href=
3086     ([\"\'])?                       # find single or double quote
3087     (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
3088                                     # quote, otherwise match up to next space
3089    /isxSI
3090    
3091    /^(?!:)                       # colon disallowed at start
3092      (?:                         # start of item
3093        (?: [0-9a-f]{1,4} |       # 1-4 hex digits or
3094        (?(1)0 | () ) )           # if null previously matched, fail; else null
3095        :                         # followed by colon
3096      ){1,7}                      # end item; 1-7 of them required
3097      [0-9a-f]{1,4} $             # final hex number at end of string
3098      (?(1)|.)                    # check that there was an empty component
3099      /xiIS
3100    
3101    /(?|(?<a>A)|(?<a>B))/I
3102        AB\Ca
3103        BA\Ca
3104    
3105    /(?|(?<a>A)|(?<b>B))/
3106    
3107    /-- End of testinput2 --/

Legend:
Removed from v.143  
changed lines
  Added in v.457

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12