/-- This set of tests is not Perl-compatible. It checks on special features of PCRE's API, error diagnostics, and the compiled code of some patterns. It also checks the non-Perl syntax the PCRE supports (Python, .NET, Oniguruma). Finally, there are some tests where PCRE and Perl differ, either because PCRE can't be compatible, or there is a possible Perl bug. --/ /-- 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. --/ /(a)b|/I /abc/I abc defabc \Aabc *** Failers \Adefabc ABC /^abc/I abc \Aabc *** Failers defabc \Adefabc /a+bc/I /a*bc/I /a{3}bc/I /(abc|a+z)/I /^abc$/I abc *** Failers def\nabc /ab\idef/X /(?X)ab\idef/X /x{5,4}/ /z{65536}/ /[abcd/ /(?X)[\B]/ /(?X)[\R]/ /(?X)[\X]/ /[\B]/BZ /[\R]/BZ /[\X]/BZ /[z-a]/ /^*/ /(abc/ /(?# abc/ /(?z)abc/ /.*b/I /.*?b/I /cat|dog|elephant/I this sentence eventually mentions a cat this sentences rambles on and on for a while and then reaches elephant /cat|dog|elephant/IS this sentence eventually mentions a cat this sentences rambles on and on for a while and then reaches elephant /cat|dog|elephant/IiS this sentence eventually mentions a CAT cat this sentences rambles on and on for a while to elephant ElePhant /a|[bcd]/IS /(a|[^\dZ])/IS /(a|b)*[\s]/IS /(ab\2)/ /{4,5}abc/ /(a)(b)(c)\2/I abcb \O0abcb \O3abcb \O6abcb \O9abcb \O12abcb /(a)bc|(a)(b)\2/I abc \O0abc \O3abc \O6abc aba \O0aba \O3aba \O6aba \O9aba \O12aba /abc$/IE abc *** Failers abc\n abc\ndef /(a)(b)(c)(d)(e)\6/ /the quick brown fox/I the quick brown fox this is a line with the quick brown fox /the quick brown fox/IA the quick brown fox *** Failers this is a line with the quick brown fox /ab(?z)cd/ /^abc|def/I abcdef abcdef\B /.*((abc)$|(def))/I defabc \Zdefabc /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 /)/ /a[]b/ /[^aeiou ]{3,}/I co-processors, and for /<.*>/I abcghinop /<.*?>/I abcghinop /<.*>/IU abcghinop /(?U)<.*>/I abcghinop /<.*?>/IU abcghinop /={3,}/IU abc========def /(?U)={3,}?/I abc========def /(?^abc)/Im abc def\nabc *** Failers defabc /(?<=ab(c+)d)ef/ /(?<=ab(?<=c+)d)ef/ /(?<=ab(c|de)f)g/ /The next three are in testinput2 because they have variable length branches/ /(?<=bullock|donkey)-cart/I the bullock-cart a donkey-cart race *** Failers cart horse-and-cart /(?<=ab(?i)x|y|z)/I /(?>.*)(?<=(abcd)|(xyz))/I alphabetabcd endingxyz /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I abxyZZ abXyZZ ZZZ zZZ bZZ BZZ *** Failers ZZ abXYZZ zzz bzz /(?[^()]+) # Either a sequence of non-brackets (no backtracking) | # Or (?R) # Recurse - i.e. nested bracketed string )* # Zero or more contents \) # Closing ) /Ix (abcd) (abcd)xyz xyz(abcd) (ab(xy)cd)pqr (ab(xycd)pqr () abc () 12(abcde(fsh)xyz(foo(bar))lmno)89 *** Failers abcd abcd) (abcd /\( ( (?>[^()]+) | (?R) )* \) /Ixg (ab(xy)cd)pqr 1(abcd)(x(y)z)pqr /\( (?: (?>[^()]+) | (?R) ) \) /Ix (abcd) (ab(xy)cd) (a(b(c)d)e) ((ab)) *** Failers () /\( (?: (?>[^()]+) | (?R) )? \) /Ix () 12(abcde(fsh)xyz(foo(bar))lmno)89 /\( ( (?>[^()]+) | (?R) )* \) /Ix (ab(xy)cd) /\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix (ab(xy)cd) /\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix (ab(xy)cd) (123ab(xy)cd) /\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix (ab(xy)cd) (123ab(xy)cd) /\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix (ab(xy)cd) /\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix (abcd(xyz

qrs)123) /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix (ab(cd)ef) (ab(cd(ef)gh)ij) /^[[:alnum:]]/DZ /^[[:^alnum:]]/DZ /^[[:alpha:]]/DZ /^[[:^alpha:]]/DZ /[_[:alpha:]]/IS /^[[:ascii:]]/DZ /^[[:^ascii:]]/DZ /^[[:blank:]]/DZ /^[[:^blank:]]/DZ /[\n\x0b\x0c\x0d[:blank:]]/IS /^[[:cntrl:]]/DZ /^[[:digit:]]/DZ /^[[:graph:]]/DZ /^[[:lower:]]/DZ /^[[:print:]]/DZ /^[[:punct:]]/DZ /^[[:space:]]/DZ /^[[:upper:]]/DZ /^[[:xdigit:]]/DZ /^[[:word:]]/DZ /^[[:^cntrl:]]/DZ /^[12[:^digit:]]/DZ /^[[:^blank:]]/DZ /[01[:alpha:]%]/DZ /[[.ch.]]/I /[[=ch=]]/I /[[:rhubarb:]]/I /[[:upper:]]/Ii A a /[[:lower:]]/Ii A a /((?-i)[[:lower:]])[[:lower:]]/Ii ab aB *** Failers Ab AB /[\200-\110]/I /^(?(0)f|b)oo/I /This one's here because of the large output vector needed/I /(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$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\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/I \O900 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC /This one's here because Perl does this differently and PCRE can't at present/I /(main(O)?)+/I mainmain mainOmain /These are all cases where Perl does it differently (nested captures)/I /^(a(b)?)+$/I aba /^(aa(bb)?)+$/I aabbaa /^(aa|aa(bb))+$/I aabbaa /^(aa(bb)??)+$/I aabbaa /^(?:aa(bb)?)+$/I aabbaa /^(aa(b(b))?)+$/I aabbaa /^(?:aa(b(b))?)+$/I aabbaa /^(?:aa(b(?:b))?)+$/I aabbaa /^(?:aa(bb(?:b))?)+$/I aabbbaa /^(?:aa(b(?:bb))?)+$/I aabbbaa /^(?:aa(?:b(b))?)+$/I aabbaa /^(?:aa(?:b(bb))?)+$/I aabbbaa /^(aa(b(bb))?)+$/I aabbbaa /^(aa(bb(bb))?)+$/I aabbbbaa /--------------------------------------------------------------------/I /#/IxDZ /a#/IxDZ /[\s]/DZ /[\S]/DZ /a(?i)b/DZ ab aB *** Failers AB /(a(?i)b)/DZ ab aB *** Failers AB / (?i)abc/IxDZ /#this is a comment (?i)abc/IxDZ /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ /\Q\E/DZ \ /\Q\Ex/DZ / \Q\E/DZ /a\Q\E/DZ abc bca bac /a\Q\Eb/DZ abc /\Q\Eabc/DZ /x*+\w/DZ *** Failers xxxxx /x?+/DZ /x++/DZ /x{1,3}+/DZ /(x)*+/DZ /^(\w++|\s++)*$/I now is the time for all good men to come to the aid of the party *** Failers this is not a line with only words and spaces! /(\d++)(\w)/I 12345a *** Failers 12345+ /a++b/I aaab /(a++b)/I aaab /(a++)b/I aaab /([^()]++|\([^()]*\))+/I ((abc(ade)ufh()()x /\(([^()]++|\([^()]+\))+\)/I (abc) (abc(def)xyz) *** Failers ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /(abc){1,3}+/DZ /a+?+/I /a{2,3}?+b/I /(?U)a+?+/I /a{2,3}?+b/IU /x(?U)a++b/DZ xaaaab /(?U)xa++b/DZ xaaaab /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/DZ /^x(?U)a+b/DZ /^x(?U)(a+)b/DZ /[.x.]/I /[=x=]/I /[:x:]/I /\l/I /\L/I /\N{name}/I /\u/I /\U/I /[/I /[a-/I /[[:space:]/I /[\s]/IDZ /[[:space:]]/IDZ /[[:space:]abcde]/IDZ /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix <> hij> hij> def> *** Failers iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\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\^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IS /a^b/I /^a/Im abcde xy\nabc *** Failers xyabc /c|abc/I /(?i)[ab]/IS /[ab](?i)cd/IS /abc(?C)def/I abcdef 1234abcdef *** Failers abcxyz abcxyzf /abc(?C)de(?C1)f/I 123abcdef /(?C1)\dabc(?C2)def/IS 1234abcdef *** Failers abcdef /(?C1)\dabc(?C2)def/ISS 1234abcdef *** Failers abcdef /(?C255)ab/I /(?C256)ab/I /(?Cab)xx/I /(?C12vr)x/I /abc(?C)def/I *** Failers \x83\x0\x61bcdef /(abc)(?C)de(?C1)f/I 123abcdef 123abcdef\C+ 123abcdef\C- *** Failers 123abcdef\C!1 /(?C0)(abc(?C1))*/I abcabcabc abcabc\C!1!3 *** Failers abcabcabc\C!1!3 /(\d{3}(?C))*/I 123\C+ 123456\C+ 123456789\C+ /((xyz)(?C)p|(?C1)xyzabc)/I xyzabc\C+ /(X)((xyz)(?C)p|(?C1)xyzabc)/I Xxyzabc\C+ /(?=(abc))(?C)abcdef/I abcdef\C+ /(?!(abc)(?C1)d)(?C2)abcxyz/I abcxyz\C+ /(?<=(abc)(?C))xyz/I abcxyz\C+ /a(b+)(c*)(?C1)/I abbbbbccc\C*1 /a(b+?)(c*?)(?C1)/I abbbbbccc\C*1 /(?C)abc/I /(?C)^abc/I /(?C)a|b/IS /(?R)/I /(a|(?R))/I /(ab|(bc|(de|(?R))))/I /x(ab|(bc|(de|(?R))))/I xab xbc xde xxab xxxab *** Failers xyab /(ab|(bc|(de|(?1))))/I /x(ab|(bc|(de|(?1)x)x)x)/I /^([^()]|\((?1)*\))*$/I abc a(b)c a(b(c))d *** Failers) a(b(c)d /^>abc>([^()]|\((?1)*\))*abc>123abc>1(2)3abc>(1(2)3)]*+) | (?2)) * >))/Ix <> hij> hij> def> *** Failers b|c)d(?Pe)/DZ abde acde /(?:a(?Pc(?Pd)))(?Pa)/DZ /(?Pa)...(?P=a)bbb(?P>a)d/DZ /^\W*(?:(?P(?P.)\W*(?P>one)\W*(?P=two)|)|(?P(?P.)\W*(?P>three)\W*(?P=four)|\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 /((?(R)a|b))\1(?1)?/I bb bbaa /(.*)a/Is /(.*)a\1/Is /(.*)a(b)\2/Is /((.*)a|(.*)b)z/Is /((.*)a|(.*)b)z\1/Is /((.*)a|(.*)b)z\2/Is /((.*)a|(.*)b)z\3/Is /((.*)a|^(.*)b)z\3/Is /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is /(a)(bc)/INDZ abc /(?Pa)(bc)/INDZ abc /(a)(?Pbc)/INDZ /(a+)*zz/I aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M aaaaaaaaaaaaaz\M /(aaa(?C1)bbb|ab)/I aaabbb aaabbb\C*0 aaabbb\C*1 aaabbb\C*-1 /ab(?Pcd)ef(?Pgh)/I abcdefgh abcdefgh\C1\Gtwo abcdefgh\Cone\Ctwo abcdefgh\Cthree /(?P)(?P)/DZ /(?P)(?P)/DZ /(?Pzz)(?Paa)/I zzaa\CZ zzaa\CA /(?Peks)(?Peccs)/I /(?Pabc(?Pdef)(?Pxyz))/I "\[((?P\d+)(,(?P>elem))*)\]"I [10,20,30,5,5,4,4,2,43,23,4234] *** Failers [] "\[((?P\d+)(,(?P>elem))*)?\]"I [10,20,30,5,5,4,4,2,43,23,4234] [] /(a(b(?2)c))?/DZ /(a(b(?2)c))*/DZ /(a(b(?2)c)){0,2}/DZ /[ab]{1}+/DZ /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii Baby Bjorn Active Carrier - With free SHIPPING!! /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/IiS Baby Bjorn Active Carrier - With free SHIPPING!! /a*.*b/ISDZ /(a|b)*.?c/ISDZ /abc(?C255)de(?C)f/DZ /abcde/ICDZ abcde abcdfe /a*b/ICDZS ab aaaab aaaacb /a*b/ICDZSS ab aaaab aaaacb /a+b/ICDZ ab aaaab aaaacb /(abc|def)x/ICDZS abcx defx ** Failers abcdefzx /(abc|def)x/ICDZSS abcx defx ** Failers abcdefzx /(ab|cd){3,4}/IC ababab abcdabcd abcdcdcdcdcd /([ab]{,4}c|xy)/ICDZS Note: that { does NOT introduce a quantifier /([ab]{,4}c|xy)/ICDZSS Note: that { does NOT introduce a quantifier /([ab]{1,4}c|xy){4,5}?123/ICDZ aacaacaacaacaac123 /\b.*/I ab cd\>1 /\b.*/Is ab cd\>1 /(?!.bcd).*/I Xbcd12345 /abcde/I ab\P abc\P abcd\P abcde\P the quick brown abc\P ** Failers\P the quick brown abxyz fox\P "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I 13/05/04\P 13/5/2004\P 02/05/09\P 1\P 1/2\P 1/2/0\P 1/2/04\P 0\P 02/\P 02/0\P 02/1\P ** Failers\P \P 123\P 33/4/04\P 3/13/04\P 0/1/2003\P 0/\P 02/0/\P 02/13\P /0{0,2}ABC/I /\d{3,}ABC/I /\d*ABC/I /[abc]+DE/I /[abc]?123/I 123\P a\P b\P c\P c12\P c123\P /^(?:\d){3,5}X/I 1\P 123\P 123X 1234\P 1234X 12345\P 12345X *** Failers 1X 123456\P /abc/IS>testsavedregex testsavedregex testsavedregex testsavedregex testsavedregex testsavedregex testsavedregex testsavedregex (.)*~smgI \J1024\n\n\nPartner der LCO\nde\nPartner der LINEAS Consulting\nGmbH\nLINEAS Consulting GmbH Hamburg\nPartnerfirmen\n30 days\nindex,follow\n\nja\n3\nPartner\n\n\nLCO\nLINEAS Consulting\n15.10.2003\n\n\n\n\nDie Partnerfirmen der LINEAS Consulting\nGmbH\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /^a/IF /line\nbreak/I this is a line\nbreak line one\nthis is a line\nbreak in the second line /line\nbreak/If this is a line\nbreak ** Failers line one\nthis is a line\nbreak in the second line /line\nbreak/Imf this is a line\nbreak ** Failers line one\nthis is a line\nbreak in the second line /ab.cd/P ab-cd ab=cd ** Failers ab\ncd /ab.cd/Ps ab-cd ab=cd ab\ncd /(?i)(?-i)AbCd/I AbCd ** Failers abcd /a{11111111111111111111}/I /(){64294967295}/I /(){2,4294967295}/I "(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B"I abcdefghijklAkB "(?Pa)(?Pb)(?Pc)(?Pd)(?Pe)(?Pf)(?Pg)(?Ph)(?Pi)(?Pj)(?Pk)(?Pl)A\11B"I abcdefghijklAkB "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I abcdefghijklAkB "(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)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(this(and)that) /[^()]*(?:\((?R)\))*[^()]*/I (this(and)that (this(and)that) /(?:\((?R)\))*[^()]*/I (this(and)that (this(and)that) ((this)) /(?:\((?R)\))|[^()]*/I (this(and)that (this(and)that) (this) ((this)) /a(b)c/PN abc /a(?Pb)c/PN abc /\x{100}/I /\x{0000ff}/I /^((?Pa1)|(?Pa2)b)/I /^((?Pa1)|(?Pa2)b)/IJ a1b\CA a2b\CA ** Failers a1b\CZ\CA /^(?Pa)(?Pb)/IJ ab\CA /^(?Pa)(?Pb)|cd/IJ ab\CA cd\CA /^(?Pa)(?Pb)|cd(?Pef)(?Pgh)/IJ cdefgh\CA /^((?Pa1)|(?Pa2)b)/IJ a1b\GA a2b\GA ** Failers a1b\GZ\GA /^(?Pa)(?Pb)/IJ ab\GA /^(?Pa)(?Pb)|cd/IJ ab\GA cd\GA /^(?Pa)(?Pb)|cd(?Pef)(?Pgh)/IJ cdefgh\GA /(?J)^((?Pa1)|(?Pa2)b)/I a1b\CA a2b\CA /^(?Pa) (?J:(?Pb)(?Pc)) (?Pd)/I / In this next test, J is not set at the outer level; consequently it isn't set in the pattern's options; consequently pcre_get_named_substring() produces a random value. /Ix /^(?Pa) (?J:(?Pb)(?Pc)) (?Pd)/I a bc d\CA\CB\CC /^(?Pa)?(?(A)a|b)/I aabc bc ** Failers abc /(?:(?(ZZ)a|b)(?PX))+/I bXaX /(?:(?(2y)a|b)(X))+/I /(?:(?(ZA)a|b)(?PX))+/I /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?PX))+/I bbXaaX /(?:(?(ZZ)a|\(b\))\\(?PX))+/I (b)\\Xa\\X /(?PX|Y))+/I bXXaYYaY bXYaXXaX /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?PX|Y))+/I bXXaYYaY /\777/I /\s*,\s*/IS \x0b,\x0b \x0c,\x0d /^abc/Im xyz\nabc xyz\nabc\ xyz\r\nabc\ xyz\rabc\ xyz\r\nabc\ ** Failers xyz\nabc\ xyz\r\nabc\ xyz\nabc\ xyz\rabc\ xyz\rabc\ /abc$/Im xyzabc xyzabc\n xyzabc\npqr xyzabc\r\ xyzabc\rpqr\ xyzabc\r\n\ xyzabc\r\npqr\ ** Failers xyzabc\r xyzabc\rpqr xyzabc\r\n xyzabc\r\npqr /^abc/Im xyz\rabcdef xyz\nabcdef\ ** Failers xyz\nabcdef /^abc/Im xyz\nabcdef xyz\rabcdef\ ** Failers xyz\rabcdef /^abc/Im xyz\r\nabcdef xyz\rabcdef\ ** Failers xyz\rabcdef /^abc/Im /abc/I xyz\rabc\ abc /.*/I abc\ndef abc\rdef abc\r\ndef \abc\ndef \abc\rdef \abc\r\ndef \abc\ndef \abc\rdef \abc\r\ndef /\w+(.)(.)?def/Is abc\ndef abc\rdef abc\r\ndef +((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+I /* this is a C style comment */\M /(?P25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I /()()()()()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()()()()()() (.(.))/Ix XY\O400 /(a*b|(?i:c*(?-i)d))/IS /()[ab]xyz/IS /(|)[ab]xyz/IS /(|c)[ab]xyz/IS /(|c?)[ab]xyz/IS /(d?|c?)[ab]xyz/IS /(d?|c)[ab]xyz/IS /^a*b\d/DZ /^a*+b\d/DZ /^a*?b\d/DZ /^a+A\d/DZ aaaA5 ** Failers aaaa5 /^a*A\d/IiDZ aaaA5 aaaa5 /(a*|b*)[cd]/IS /(a+|b*)[cd]/IS /(a*|b+)[cd]/IS /(a+|b+)[cd]/IS /(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ((( a )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ))) /Ix large nest /a*\d/BZ /a*\D/BZ /0*\d/BZ /0*\D/BZ /a*\s/BZ /a*\S/BZ / *\s/BZ / *\S/BZ /a*\w/BZ /a*\W/BZ /=*\w/BZ /=*\W/BZ /\d*a/BZ /\d*2/BZ /\d*\d/BZ /\d*\D/BZ /\d*\s/BZ /\d*\S/BZ /\d*\w/BZ /\d*\W/BZ /\D*a/BZ /\D*2/BZ /\D*\d/BZ /\D*\D/BZ /\D*\s/BZ /\D*\S/BZ /\D*\w/BZ /\D*\W/BZ /\s*a/BZ /\s*2/BZ /\s*\d/BZ /\s*\D/BZ /\s*\s/BZ /\s*\S/BZ /\s*\w/BZ /\s*\W/BZ /\S*a/BZ /\S*2/BZ /\S*\d/BZ /\S*\D/BZ /\S*\s/BZ /\S*\S/BZ /\S*\w/BZ /\S*\W/BZ /\w*a/BZ /\w*2/BZ /\w*\d/BZ /\w*\D/BZ /\w*\s/BZ /\w*\S/BZ /\w*\w/BZ /\w*\W/BZ /\W*a/BZ /\W*2/BZ /\W*\d/BZ /\W*\D/BZ /\W*\s/BZ /\W*\S/BZ /\W*\w/BZ /\W*\W/BZ /[^a]+a/BZ /[^a]+a/BZi /[^a]+A/BZi /[^a]+b/BZ /[^a]+\d/BZ /a*[^a]/BZ /(?Px)(?Py)/I xy\Cabc\Cxyz /(?x)(?'xyz'y)/I xy\Cabc\Cxyz /(?x)(?'xyz>y)/I /(?P'abc'x)(?Py)/I /^(?:(?(ZZ)a|b)(?X))+/ bXaX bXbX ** Failers aXaX aXbX /^(?P>abc)(?xxx)/ /^(?P>abc)(?x|y)/ xx xy yy yx /^(?P>abc)(?Px|y)/ xx xy yy yx /^((?(abc)a|b)(?x|y))+/ bxay bxby ** Failers axby /^(((?P=abc)|X)(?x|y))+/ XxXxxx XxXyyx XxXyxx ** Failers x /^(?1)(abc)/ abcabc /^(?:(?:\1|X)(a|b))+/ Xaaa Xaba /^[\E\Qa\E-\Qz\E]+/BZ /^[a\Q]bc\E]/BZ /^[a-\Q\E]/BZ /^(?P>abc)[()](?)/BZ /^((?(abc)y)[()](?Px))+/BZ (xy)x /^(?P>abc)\Q()\E(?)/BZ /^(?P>abc)[a\Q(]\E(](?)/BZ /^(?P>abc) # this is (a comment) (?)/BZx /^\W*(?:(?(?.)\W*(?&one)\W*\k|)|(?(?.)\W*(?&three)\W*\k'four'|\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 /(?=(\w+))\1:/I abcd: /(?=(?'abc'\w+))\k:/I abcd: /(?'abc'a|b)(?d|e)\k{2}/J adaa ** Failers addd adbb /(?'abc'a|b)(?d|e)(?&abc){2}/J bdaa bdab ** Failers bddd /(?( (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x abcabc1Xabc2XabcXabcabc /(? (?'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 abcabc1Xabc2XabcXabcabc /^(?(DEFINE) abc | xyz ) /x /(?(DEFINE) abc) xyz/xI /(a|)*\d/ \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 /^a.b/ a\rb a\nb\ a\x85b\ ** Failers a\nb a\nb\ a\rb\ a\rb\ a\x85b\ a\rb\ /^abc./mgx abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK /abc.$/mgx abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9 /a/ /a/ /^a\Rb/ a\nb a\rb a\r\nb a\x0bb a\x0cb a\x85b ** Failers a\n\rb /^a\R*b/ ab a\nb a\rb a\r\nb a\x0bb a\x0cb a\x85b a\n\rb a\n\r\x85\x0cb /^a\R+b/ a\nb a\rb a\r\nb a\x0bb a\x0cb a\x85b a\n\rb a\n\r\x85\x0cb ** Failers ab /^a\R{1,3}b/ a\nb a\n\rb a\n\r\x85b a\r\n\r\nb a\r\n\r\n\r\nb a\n\r\n\rb a\n\n\r\nb ** Failers a\n\n\n\rb a\r /^a[\R]b/ aRb ** Failers a\nb /(?&abc)X(?P)/I abcPXP123 /(?1)X(?P)/I abcPXP123 /(?:a(?&abc)b)*(?x)/ 123axbaxbaxbx456 123axbaxbaxb456 /(?:a(?&abc)b){1,5}(?x)/ 123axbaxbaxbx456 /(?:a(?&abc)b){2,5}(?x)/ 123axbaxbaxbx456 /(?:a(?&abc)b){2,}(?x)/ 123axbaxbaxbx456 /(abc)(?i:(?1))/ defabcabcxyz DEFabcABCXYZ /(abc)(?:(?i)(?1))/ defabcabcxyz DEFabcABCXYZ /^(a)\g-2/ /^(a)\g/ /^(a)\g{0}/ /^(a)\g{3/ /^(a)\g{4a}/ /^a.b/ a\rb *** Failers a\nb /.+foo/ afoo ** Failers \r\nfoo \nfoo /.+foo/ afoo \nfoo ** Failers \r\nfoo /.+foo/ afoo ** Failers \nfoo \r\nfoo /.+foo/s afoo \r\nfoo \nfoo /^$/mg abc\r\rxyz abc\n\rxyz ** Failers abc\r\nxyz /(?m)^$/g+ abc\r\n\r\n /(?m)^$|^\r\n/g+ abc\r\n\r\n /(?m)$/g+ abc\r\n\r\n /abc.$/mgx abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 /^X/m XABC ** Failers XABC\B /(ab|c)(?-1)/BZ abc /xy(?+1)(abc)/BZ xyabcabc ** Failers xyabc /x(?-0)y/ /x(?-1)y/ /x(?+0)y/ /x(?+1)y/ /^(abc)?(?(-1)X|Y)/BZ abcX Y **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(*CRLF)a.b/ a\rb a\nb ** Failers a\r\nb /(*ANYCRLF)a.b/ ** Failers a\rb a\nb a\r\nb /(*ANY)a.b/ ** Failers a\rb a\nb a\r\nb a\x85b /(*ANY).*/g abc\r\ndef /(*ANYCRLF).*/g abc\r\ndef /(*CRLF).*/g abc\r\ndef /a\Rb/I a\rb a\nb a\r\nb ** Failers a\x85b a\x0bb /a\Rb/I a\rb a\nb a\r\nb a\x85b a\x0bb ** Failers a\x85b\ a\x0bb\ /a\R?b/I a\rb a\nb a\r\nb ** Failers a\x85b a\x0bb /a\R?b/I a\rb a\nb a\r\nb a\x85b a\x0bb ** Failers a\x85b\ a\x0bb\ /a\R{2,4}b/I a\r\n\nb a\n\r\rb a\r\n\r\n\r\n\r\nb ** Failers a\x85\85b a\x0b\0bb /a\R{2,4}b/I a\r\rb a\n\n\nb a\r\n\n\r\rb a\x85\85b a\x0b\0bb ** Failers a\r\r\r\r\rb a\x85\85b\ a\x0b\0bb\ /(*BSR_ANYCRLF)a\Rb/I a\nb a\rb /(*BSR_UNICODE)a\Rb/I a\x85b /(*BSR_ANYCRLF)(*CRLF)a\Rb/I a\nb a\rb /(*CRLF)(*BSR_UNICODE)a\Rb/I a\x85b /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I /(?)(?&)/ /(?)(?&a)/ /(?)(?&aaaaaaaaaaaaaaaaaaaaaaa)/ /(?+-a)/ /(?-+a)/ /(?(-1))/ /(?(+10))/ /(?(10))/ /(?(+2))()()/ /(?(2))()()/ /\k''/ /\k<>/ /\k{}/ /\k/ /\kabc/ /(?P=)/ /(?P>)/ /(?!\w)(?R)/ /(?=\w)(?R)/ /(?x|y){0}z/ xzxx yzyy ** Failers xxz /(\3)(\1)(a)/ cat /(\3)(\1)(a)/ cat /TA]/ The ACTA] comes /TA]/ The ACTA] comes /(?2)[]a()b](abc)/ abcbabc /(?2)[^]a()b](abc)/ abcbabc /(?1)[]a()b](abc)/ abcbabc ** Failers abcXabc /(?1)[^]a()b](abc)/ abcXabc ** Failers abcbabc /(?2)[]a()b](abc)(xyz)/ xyzbabcxyz /(?&N)[]a(?)](?abc)/ abc)](abc)/ abc ** Failers ab /a[]+b/ ** Failers ab /a[]*+b/ ** Failers ab /a[^]b/ aXb a\nb ** Failers ab /a[^]+b/ aXb a\nX\nXb ** Failers ab /a(?!)+b/ /a(*FAIL)+b/ /(abc|pqr|123){0}[xyz]/SI /(?(?=.*b)b|^)/CI adc abc /(?(?=b).*b|^d)/I /(?(?=.*b).*b|^d)/I /a?|b?/P abc ** Failers ddd\N /xyz/C xyz abcxyz abcxyz\Y ** Failers abc abc\Y abcxypqr abcxypqr\Y /(*NO_START_OPT)xyz/C abcxyz /xyz/CY abcxyz /^"((?(?=[a])[^"])|b)*"$/C "ab" /^"((?(?=[a])[^"])|b)*"$/ "ab" /^X(?5)(a)(?|(b)|(q))(c)(d)Y/ XYabcdY /^X(?&N)(a)(?|(b)|(q))(c)(d)(?Y)/ XYabcdY /Xa{2,4}b/ X\P Xa\P Xaa\P Xaaa\P Xaaaa\P /Xa{2,4}?b/ X\P Xa\P Xaa\P Xaaa\P Xaaaa\P /Xa{2,4}+b/ X\P Xa\P Xaa\P Xaaa\P Xaaaa\P /X\d{2,4}b/ X\P X3\P X33\P X333\P X3333\P /X\d{2,4}?b/ X\P X3\P X33\P X333\P X3333\P /X\d{2,4}+b/ X\P X3\P X33\P X333\P X3333\P /X\D{2,4}b/ X\P Xa\P Xaa\P Xaaa\P Xaaaa\P /X\D{2,4}?b/ X\P Xa\P Xaa\P Xaaa\P Xaaaa\P /X\D{2,4}+b/ X\P Xa\P Xaa\P Xaaa\P Xaaaa\P /X[abc]{2,4}b/ X\P Xa\P Xaa\P Xaaa\P Xaaaa\P /X[abc]{2,4}?b/ X\P Xa\P Xaa\P Xaaa\P Xaaaa\P /X[abc]{2,4}+b/ X\P Xa\P Xaa\P Xaaa\P Xaaaa\P /X[^a]{2,4}b/ X\P Xz\P Xzz\P Xzzz\P Xzzzz\P /X[^a]{2,4}?b/ X\P Xz\P Xzz\P Xzzz\P Xzzzz\P /X[^a]{2,4}+b/ X\P Xz\P Xzz\P Xzzz\P Xzzzz\P /(Y)X\1{2,4}b/ YX\P YXY\P YXYY\P YXYYY\P YXYYYY\P /(Y)X\1{2,4}?b/ YX\P YXY\P YXYY\P YXYYY\P YXYYYY\P /(Y)X\1{2,4}+b/ YX\P YXY\P YXYY\P YXYYY\P YXYYYY\P /\++\KZ|\d+X|9+Y/ ++++123999\P ++++123999Y\P ++++Z1234\P /Z(*F)/ Z\P ZA\P /Z(?!)/ Z\P ZA\P /dog(sbody)?/ dogs\P dogs\P\P /dog(sbody)??/ dogs\P dogs\P\P /dog|dogsbody/ dogs\P dogs\P\P /dogsbody|dog/ dogs\P dogs\P\P /\bthe cat\b/ the cat\P the cat\P\P /abc/ abc\P abc\P\P /\w+A/P CDAAAAB /\w+A/PU CDAAAAB /abc\K123/ xyzabc123pqr xyzabc12\P xyzabc12\P\P /(?<=abc)123/ xyzabc123pqr xyzabc12\P xyzabc12\P\P /\babc\b/ +++abc+++ +++ab\P +++ab\P\P /(?&word)(?&element)(?(DEFINE)(?<[^m][^>]>[^<])(?\w*+))/BZ /(?&word)(?&element)(?(DEFINE)(?<[^\d][^>]>[^<])(?\w*+))/BZ /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ /abc\K/+ abcdef abcdef\N\N xyzabcdef\N\N ** Failers abcdef\N xyzabcdef\N /^(?:(?=abc)|abc\K)/+ abcdef abcdef\N\N ** Failers abcdef\N /a?b?/+ xyz xyzabc xyzabc\N xyzabc\N\N xyz\N\N ** Failers xyz\N /^a?b?/+ xyz xyzabc ** Failers xyzabc\N xyzabc\N\N xyz\N\N xyz\N /^(?a|b\gc)/ aaaa bacxxx bbaccxxx bbbacccxx /^(?a|b\g'name'c)/ aaaa bacxxx bbaccxxx bbbacccxx /^(a|b\g<1>c)/ aaaa bacxxx bbaccxxx bbbacccxx /^(a|b\g'1'c)/ aaaa bacxxx bbaccxxx bbbacccxx /^(a|b\g'-1'c)/ aaaa bacxxx bbaccxxx bbbacccxx /(^(a|b\g<-1>c))/ aaaa bacxxx bbaccxxx bbbacccxx /(?-i:\g)(?i:(?a))/ XaaX XAAX /(?i:\g)(?-i:(?a))/ XaaX ** Failers XAAX /(?-i:\g<+1>)(?i:(a))/ XaaX XAAX /(?=(?(?#simplesyntax)\$(?[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g)\]|->\g(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g(?\[(?:\g|'(?:\\.|[^'\\])*'|"(?:\g|\\.|[^"\\])*")\])?|\g|\$\{\g\})\}|(?#complexsyntax)\{(?\$(?\g(\g*|\(.*?\))?)(?:->\g)*|\$\g|\$\{\g\})\}))\{/ /(?a|b|c)\g*/ abc accccbbb /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/ XYabcdY /(?<=b(?1)|zzz)(a)/ xbaax xzzzax /(a)(?<=b\1)/ /(a)(?<=b+(?1))/ /(a+)(?<=b(?1))/ /(a(?<=b(?1)))/ /(?<=b(?1))xyz/ /(?<=b(?1))xyz(b+)pqrstuvew/ /(a|bc)\1/SI /(a|bc)\1{2,3}/SI /(a|bc)(?1)/SI /(a|b\1)(a|b\1)/SI /(a|b\1){2}/SI /(a|bbbb\1)(a|bbbb\1)/SI /(a|bbbb\1){2}/SI /^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 / (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* # optional leading comment (?: (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | " (?: # opening quote... [^\\\x80-\xff\n\015"] # Anything except backslash and quote | # or \\ [^\x80-\xff] # Escaped something (something != CR) )* " # closing quote ) # initial word (?: (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* \. (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | " (?: # opening quote... [^\\\x80-\xff\n\015"] # Anything except backslash and quote | # or \\ [^\x80-\xff] # Escaped something (something != CR) )* " # closing quote ) )* # further okay, if led by a period (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* @ (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | \[ # [ (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff \] # ] ) # initial subdomain (?: # (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* \. # if led by a period... (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | \[ # [ (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff \] # ] ) # ...further okay )* # address | # or (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | " (?: # opening quote... [^\\\x80-\xff\n\015"] # Anything except backslash and quote | # or \\ [^\x80-\xff] # Escaped something (something != CR) )* " # closing quote ) # one word, optionally followed by.... (?: [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) | # comments, or... " (?: # opening quote... [^\\\x80-\xff\n\015"] # Anything except backslash and quote | # or \\ [^\x80-\xff] # Escaped something (something != CR) )* " # closing quote # quoted strings )* < (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* # leading < (?: @ (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | \[ # [ (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff \] # ] ) # initial subdomain (?: # (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* \. # if led by a period... (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | \[ # [ (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff \] # ] ) # ...further okay )* (?: (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* , (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* @ (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | \[ # [ (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff \] # ] ) # initial subdomain (?: # (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* \. # if led by a period... (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | \[ # [ (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff \] # ] ) # ...further okay )* )* # further okay, if led by comma : # closing colon (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* )? # optional route (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | " (?: # opening quote... [^\\\x80-\xff\n\015"] # Anything except backslash and quote | # or \\ [^\x80-\xff] # Escaped something (something != CR) )* " # closing quote ) # initial word (?: (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* \. (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | " (?: # opening quote... [^\\\x80-\xff\n\015"] # Anything except backslash and quote | # or \\ [^\x80-\xff] # Escaped something (something != CR) )* " # closing quote ) )* # further okay, if led by a period (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* @ (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | \[ # [ (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff \] # ] ) # initial subdomain (?: # (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* \. # if led by a period... (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* (?: [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom | \[ # [ (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff \] # ] ) # ...further okay )* # address spec (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* > # trailing > # name and address ) (?: [\040\t] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* \) )* # optional trailing comment /xSI /]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/isIS "(?>.*/)foo"SI /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI /A)|(?
B))/I AB\Ca BA\Ca /(?|(?A)|(?B))/ /(?:a(? (?')|(?")) | b(? (?')|(?")) ) (?('quote')[a-z]+|[0-9]+)/JIx a"aaaaa b"aaaaa ** Failers b"11111 a"11111 /^(?|(a)(b)(c)(?d)|(?e)) (?('D')X|Y)/JDZx abcdX eX ** Failers abcdY ey /(?a) (b)(c) (?d (?(R&A)$ | (?4)) )/JDZx abcdd ** Failers abcdde /abcd*/ xxxxabcd\P xxxxabcd\P\P /abcd*/i xxxxabcd\P xxxxabcd\P\P XXXXABCD\P XXXXABCD\P\P /abc\d*/ xxxxabc1\P xxxxabc1\P\P /(a)bc\1*/ xxxxabca\P xxxxabca\P\P /abc[de]*/ xxxxabcde\P xxxxabcde\P\P /-- This is not in the Perl >= 5.10 test because Perl seems currently to be broken and not behaving as specified in that it *does* bumpalong after hitting (*COMMIT). --/ /(?1)(A(*COMMIT)|B)D/ ABD XABD BAD ABXABD ** Failers ABX BAXBAD /(\3)(\1)(a)/ cat /(\3)(\1)(a)/SI cat /(\3)(\1)(a)/SI cat /i(?(DEFINE)(?a))/SI i /()i(?(1)a)/SI ia /(?i)a(?-i)b|c/BZ XabX XAbX CcC ** Failers XABX /(?i)a(?s)b|c/BZ /(?i)a(?s-i)b|c/BZ /^(ab(c\1)d|x){2}$/BZ xabcxd /^(?&t)*+(?(DEFINE)(?.))$/BZ /^(?&t)*(?(DEFINE)(?.))$/BZ / -- The first four of these are not in the Perl >= 5.10 test because Perl documents that the use of \K in assertions is "not well defined". The last is here because Perl gives the match as "b" rather than "ab". I believe this to be a Perl bug. --/ /(?=a\Kb)ab/ ab /(?!a\Kb)ac/ ac /^abc(?<=b\Kc)d/ abcd /^abc(?a\Kb)z|(ab)/ ab /----------------------/ /(?P(?P0|)|(?P>L2)(?P>L1))/ /abc(*MARK:)pqr/ /abc(*:)pqr/ /abc(*FAIL:123)xyz/ /--- This should, and does, fail. In Perl, it does not, which I think is a bug because replacing the B in the pattern by (B|D) does make it fail. ---/ /A(*COMMIT)B/+K ACABX /--- These should be different, but in Perl 5.11 are not, which I think is a bug in Perl. ---/ /A(*THEN)B|A(*THEN)C/K AC /A(*PRUNE)B|A(*PRUNE)C/K AC /--- A whole lot of tests of verbs with arguments are here rather than in test 11 because Perl doesn't seem to follow its specification entirely correctly. ---/ /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is not clear how Perl defines "involved in the failure of the match". ---/ /^(A(*THEN:A)B|C(*THEN:B)D)/K AB CD ** Failers AC CB /--- Check the use of names for success and failure. PCRE doesn't show these names for success, though Perl does, contrary to its spec. ---/ /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K AB CD ** Failers AC CB /--- An empty name does not pass back an empty string. It is the same as if no name were given. ---/ /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K AB CD /--- PRUNE goes to next bumpalong; COMMIT does not. ---/ /A(*PRUNE:A)B/K ACAB /(*MARK:A)(*PRUNE:B)(C|X)/KS C D /(*MARK:A)(*PRUNE:B)(C|X)/KSS C D /(*MARK:A)(*THEN:B)(C|X)/KS C D /(*MARK:A)(*THEN:B)(C|X)/KSY C D /(*MARK:A)(*THEN:B)(C|X)/KSS C D /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/ /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK AAAC /--- Same --/ /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK AAAC /--- This should fail; the SKIP advances by one, but when we get to AC, the PRUNE kills it. ---/ /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK AAAC /A(*:A)A+(*SKIP)(B|Z) | AC/xK AAAC /--- This should fail, as a null name is the same as no name ---/ /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK AAAC /--- This fails in PCRE, and I think that is in accordance with Perl's documentation, though in Perl it succeeds. ---/ /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK AAAC /--- Mark names can be duplicated ---/ /A(*:A)B|X(*:A)Y/K AABC XXYZ /^A(*:A)B|^X(*:A)Y/K ** Failers XAQQ /--- A check on what happens after hitting a mark and them bumping along to something that does not even start. Perl reports tags after the failures here, though it does not when the individual letters are made into something more complicated. ---/ /A(*:A)B|XX(*:B)Y/K AABC XXYZ ** Failers XAQQ XAQQXZZ AXQQQ AXXQQQ /--- COMMIT at the start of a pattern should be the same as an anchor. Perl optimizations defeat this. So does the PCRE optimization unless we disable it with \Y. ---/ /(*COMMIT)ABC/ ABCDEFG ** Failers DEFGABC\Y /--- Repeat some tests with added studying. ---/ /A(*COMMIT)B/+KS ACABX /A(*THEN)B|A(*THEN)C/KS AC /A(*PRUNE)B|A(*PRUNE)C/KS AC /^(A(*THEN:A)B|C(*THEN:B)D)/KS AB CD ** Failers AC CB /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS AB CD ** Failers AC CB /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS AB CD /A(*PRUNE:A)B/KS ACAB /(*MARK:A)(*PRUNE:B)(C|X)/KS C D /(*MARK:A)(*THEN:B)(C|X)/KS C D /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS AAAC /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS AAAC /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS AAAC /A(*:A)A+(*SKIP)(B|Z) | AC/xKS AAAC /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS AAAC /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS AAAC /A(*:A)B|XX(*:B)Y/KS AABC XXYZ ** Failers XAQQ XAQQXZZ AXQQQ AXXQQQ /(*COMMIT)ABC/ ABCDEFG ** Failers DEFGABC\Y /^(ab (c+(*THEN)cd) | xyz)/x abcccd /^(ab (c+(*PRUNE)cd) | xyz)/x abcccd /^(ab (c+(*FAIL)cd) | xyz)/x abcccd /--- Perl 5.11 gets some of these wrong ---/ /(?>.(*ACCEPT))*?5/ abcde /(.(*ACCEPT))*?5/ abcde /(.(*ACCEPT))5/ abcde /(.(*ACCEPT))*5/ abcde /A\NB./BZ ACBD *** Failers A\nB ACB\n /A\NB./sBZ ACBD ACB\n *** Failers A\nB /A\NB/ A\nB A\rB ** Failers A\r\nB /\R+b/BZ /\R+\n/BZ /\R+\d/BZ /\d*\R/BZ /\s*\R/BZ /-- Perl treats this one differently, not failing the second string. I believe that is a bug in Perl. --/ /^((abc|abcx)(*THEN)y|abcd)/ abcd *** Failers abcxy /(?<=abc)def/ abc\P\P /abc$/ abc abc\P abc\P\P /abc$/m abc abc\n abc\P\P abc\n\P\P abc\P abc\n\P /abc\z/ abc abc\P abc\P\P /abc\Z/ abc abc\P abc\P\P /abc\b/ abc abc\P abc\P\P /abc\B/ abc abc\P abc\P\P /.+/ abc\>0 abc\>1 abc\>2 abc\>3 abc\>4 abc\>-4 /^\cģ/ /(?P(?P=abn)xxx)/BZ /(a\1z)/BZ /(?P(?P=abn)(?(?P=axn)xxx)/BZ /(?P(?P=axn)xxx)(?yy)/BZ /-- These tests are here because Perl gets the first one wrong. --/ /(\R*)(.)/s \r\n \r\r\n\n\r \r\r\n\n\r\n /(\R)*(.)/s \r\n \r\r\n\n\r \r\r\n\n\r\n /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s \r\n \r\r\n\n\r \r\r\n\n\r\n /-- --/ /^abc$/BZ /^abc$/BZm /^(a)*+(\w)/S aaaaX ** Failers aaaa /^(?:a)*+(\w)/S aaaaX ** Failers aaaa /(a)++1234/SDZ /([abc])++1234/SI /(?<=(abc)+)X/ /(^ab)/I /(^ab)++/I /(^ab|^)+/I /(^ab|^)++/I /(?:^ab)/I /(?:^ab)++/I /(?:^ab|^)+/I /(?:^ab|^)++/I /(.*ab)/I /(.*ab)++/I /(.*ab|.*)+/I /(.*ab|.*)++/I /(?:.*ab)/I /(?:.*ab)++/I /(?:.*ab|.*)+/I /(?:.*ab|.*)++/I /(?=a)[bcd]/I /((?=a))[bcd]/I /((?=a))+[bcd]/I /((?=a))++[bcd]/I /(?=a+)[bcd]/iI /(?=a+?)[bcd]/iI /(?=a++)[bcd]/iI /(?=a{3})[bcd]/iI /(abc)\1+/S /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/ /(?1)(?:(b(*ACCEPT))){0}/ b /(?1)(?:(b(*ACCEPT))){0}c/ bc ** Failers b /(?1)(?:((*ACCEPT))){0}c/ c c\N /^.*?(?(?=a)a|b(*THEN)c)/ ba /^.*?(?(?=a)a|bc)/ ba /^.*?(?(?=a)a(*THEN)b|c)/ ac /^.*?(?(?=a)a(*THEN)b)c/ ac /^.*?(a(*THEN)b)c/ aabc /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x aabc /^.*?(a(*THEN)b|z)c/ aabc /^.*?(z|a(*THEN)b)c/ aabc /-- --/ /-- These studied versions are here because they are not Perl-compatible; the studying means the mark is not seen. --/ /(*MARK:A)(*SKIP:B)(C|X)/KS C D /(*:A)A+(*SKIP:A)(B|Z)/KS AAAC /-- --/ "(?=a*(*ACCEPT)b)c" c c\N /(?1)c(?(DEFINE)((*ACCEPT)b))/ c c\N /(?>(*ACCEPT)b)c/ c c\N /(?:(?>(a)))+a%/++ %aa% /(a)b|ac/++SS ac\O3 /(a)(b)x|abc/++ abc\O6 /(a)bc|(a)(b)\2/ \O3abc \O4abc /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI /(a(?2)|b)(b(?1)|a)(?1)(?2)/SI /(abc)(?1)/SI /^(?>a)++/ aa\M aaaaaaaaa\M /(a)(?1)++/ aa\M aaaaaaaaa\M /(?:(foo)|(bar)|(baz))X/SS= bazfooX foobazbarX barfooX bazX foobarbazX bazfooX\O0 bazfooX\O2 bazfooX\O4 bazfooX\O6 bazfooX\O8 bazfooX\O10 /(?=abc){3}abc/BZ /(?=abc)+abc/BZ /(?=abc)++abc/BZ /(?=abc){0}xyz/BZ /(?=(a))?./BZ /(?=(a))??./BZ /^(?=(a)){0}b(?1)/BZ /(?(DEFINE)(a))?b(?1)/BZ /^(?=(?1))?[az]([abc])d/BZ /^(?!a){0}\w+/BZ /(?<=(abc))?xyz/BZ /[:a[:abc]b:]/BZ /((?2))((?1))/SS abc /((?(R2)a+|(?1)b))/SS aaaabcde /(?(R)a*(?1)|((?R))b)/SS aaaabcde /(a+|(?R)b)/ /^(a(*:A)(d|e(*:B))z|aeq)/C adz aez aeqwerty /.(*F)/ \P\Pabc /\btype\b\W*?\btext\b\W*?\bjavascript\b/IS /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|a+)(?>(z+))\w/BZ aaaazzzzb ** Failers aazz /(.)(\1|a(?2))/ bab /\1|(.)(?R)\1/ cbbbc /(.)((?(1)c|a)|a(?2))/ baa /(?P(?P=abn)xxx)/BZ /(a\1z)/BZ /^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/ \Maabbccddee /^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/ \Maabbccddee /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/ \Maabbccddee /^a\x41z/ aAz *** Failers ax41z /^a[m\x41]z/ aAz /^a\x1z/ ax1z /^a\X41z/ aX41z *** Failers aAz /^a\u0041z/ aAz *** Failers au0041z /^a[m\u0041]z/ aAz /^a\u041z/ au041z *** Failers aAz /^a\U0041z/ aU0041z *** Failers aAz /(?(?=c)c|d)++Y/BZ /(?(?=c)c|d)*+Y/BZ /(?<=ab\Cde)X/8 /a[\NB]c/ aNc /a[B-\Nc]/ /-- End of testinput2 --/