--- embedaddon/pcre/testdata/testinput2 2012/02/21 23:05:52 1.1.1.1 +++ embedaddon/pcre/testdata/testinput2 2014/06/15 19:46:05 1.1.1.5 @@ -5,13 +5,11 @@ either because PCRE can't be compatible, or there is a possible Perl bug. - NOTE: This is a non-UTF-8 set of tests. When UTF-8 is needed, use test - 5, and if Unicode Property Support is needed, use test 13. --/ + NOTE: This is a non-UTF set of tests. When UTF support is needed, use + test 5, and if Unicode Property Support is needed, use test 7. --/ + +< forbid 8W -/-- 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 @@ -147,40 +145,6 @@ 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/ @@ -351,12 +315,6 @@ *** Failers fooabar -/This one is here because Perl 5.005_02 doesn't fail it/I - -/^(a)?(?(1)a|b)+$/I - *** Failers - a - /This one is here because Perl behaves differently; see also the following/I /^(a\1?){4}$/I @@ -445,8 +403,6 @@ /abc/\ -/abc/\P - /abc/\i /(a)bc(d)/I @@ -494,9 +450,6 @@ /\Biss\B/I+ Mississippi -/\Biss\B/I+P - Mississippi - /iss/IG+ Mississippi @@ -632,15 +585,6 @@ *** Failers \Nabc -/a*(b+)(z)(z)/P - aaaabbbbzzzz - aaaabbbbzzzz\O0 - aaaabbbbzzzz\O1 - aaaabbbbzzzz\O2 - aaaabbbbzzzz\O3 - aaaabbbbzzzz\O4 - aaaabbbbzzzz\O5 - /^.?abcd/IS /\( # ( at start @@ -887,8 +831,14 @@ /x++/DZ -/x{1,3}+/DZ +/x{1,3}+/BZO +/x{1,3}+/BZOi + +/[^x]{1,3}+/BZO + +/[^x]{1,3}+/BZOi + /(x)*+/DZ /^(\w++|\s++)*$/I @@ -1494,17 +1444,6 @@ ** 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 @@ -1555,14 +1494,6 @@ (this) ((this)) -/a(b)c/PN - abc - -/a(?Pb)c/PN - abc - -/\x{100}/I - /\x{0000ff}/I /^((?Pa1)|(?Pa2)b)/I @@ -1572,6 +1503,8 @@ a2b\CA ** Failers a1b\CZ\CA + +/(?|(?)(?)(?)|(?)(?)(?))/IJ /^(?Pa)(?Pb)/IJ ab\CA @@ -1640,8 +1573,6 @@ a random value. /Ix /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?PX|Y))+/I bXXaYYaY -/\777/I - /\s*,\s*/IS \x0b,\x0b \x0c,\x0d @@ -2014,11 +1945,8 @@ a random value. /Ix /(? (?'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 +/(? (?'B' abc (?(R) (?(R&C)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 @@ -2134,7 +2062,7 @@ a random value. /Ix /^(a)\g{3/ -/^(a)\g{4a}/ +/^(a)\g{aa}/ /^a.b/ a\rb @@ -2244,22 +2172,6 @@ a random value. /Ix xabcpqrx xxyzx -/[\h]/BZ - >\x09< - -/[\h]+/BZ - >\x09\x20\xa0< - -/[\v]/BZ - -/[\H]/BZ - -/[^\h]/BZ - -/[\V]/BZ - -/[\x0a\V]/BZ - /\H++X/BZ ** Failers XXXX @@ -2605,8 +2517,11 @@ a random value. /Ix ** Failers ab -/a(?!)+b/ +/a(?!)b/BZ +/(?!)?a/BZ + ab + /a(*FAIL)+b/ /(abc|pqr|123){0}[xyz]/SI @@ -2619,11 +2534,6 @@ a random value. /Ix /(?(?=.*b).*b|^d)/I -/a?|b?/P - abc - ** Failers - ddd\N - /xyz/C xyz abcxyz @@ -2635,7 +2545,9 @@ a random value. /Ix abcxypqr\Y /(*NO_START_OPT)xyz/C - abcxyz + abcxyz + +/(*NO_AUTO_POSSESS)a+b/BZ /xyz/CY abcxyz @@ -2815,12 +2727,6 @@ a random value. /Ix abc\P abc\P\P -/\w+A/P - CDAAAAB - -/\w+A/PU - CDAAAAB - /abc\K123/ xyzabc123pqr xyzabc12\P @@ -2964,201 +2870,6 @@ a random value. /Ix /^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 @@ -3234,7 +2945,7 @@ a random value. /Ix xxxxabcde\P xxxxabcde\P\P -/-- This is not in the Perl >= 5.10 test because Perl seems currently to be +/-- This is not in the Perl-compatible test because Perl seems currently to be broken and not behaving as specified in that it *does* bumpalong after hitting (*COMMIT). --/ @@ -3280,28 +2991,12 @@ a random value. /Ix /^(?&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 +/ -- This one 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/ @@ -3316,7 +3011,7 @@ a random value. /Ix /A(*COMMIT)B/+K ACABX -/--- These should be different, but in Perl 5.11 are not, which I think +/--- These should be different, but in Perl they are not, which I think is a bug in Perl. ---/ /A(*THEN)B|A(*THEN)C/K @@ -3325,12 +3020,6 @@ a random value. /Ix /A(*PRUNE)B|A(*PRUNE)C/K AC -/--- This should fail; the SKIP advances by one, but when we get to AC, the - PRUNE kills it. Perl behaves differently. ---/ - -/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK - AAAC - /--- Mark names can be duplicated. Perl doesn't give a mark for this one, though PCRE does. ---/ @@ -3356,7 +3045,7 @@ with \Y. ---/ /^(ab (c+(*FAIL)cd) | xyz)/x abcccd -/--- Perl 5.11 gets some of these wrong ---/ +/--- Perl gets some of these wrong ---/ /(?>.(*ACCEPT))*?5/ abcde @@ -3397,15 +3086,25 @@ with \Y. ---/ /\d*\R/BZ /\s*\R/BZ + \x20\x0a + \x20\x0d + \x20\x0d\x0a -/-- Perl treats this one differently, not failing the second string. I believe - that is a bug in Perl. --/ +/\S*\R/BZ + a\x0a -/^((abc|abcx)(*THEN)y|abcd)/ - abcd - *** Failers - abcxy +/X\h*\R/BZ + X\x20\x0a +/X\H*\R/BZ + X\x0d\x0a + +/X\H+\R/BZ + X\x0d\x0a + +/X\H++\R/BZ + X\x0d\x0a + /(?<=abc)def/ abc\P\P @@ -3704,7 +3403,7 @@ with \Y. ---/ /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|a+)(?>(z+))\w/BZ aaaazzzzb ** Failers @@ -3841,6 +3494,8 @@ AbcdCBefgBhiBqz /a[B-\Nc]/ +/a[B\Nc]/ + /(a)(?2){0,1999}?(b)/ /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/ @@ -3875,5 +3530,519 @@ replaced by single letters. --/ /^a(*:X)bcde/K abc\P + +/-- These are here because Perl doesn't return a mark, except for the first --/ + +/(?=(*:x))(q|)/K+ + abc + +/(?=(*:x))((*:y)q|)/K+ + abc + +/(?=(*:x))(?:(*:y)q|)/K+ + abc + +/(?=(*:x))(?>(*:y)q|)/K+ + abc + +/(?=a(*:x))(?!a(*:y)c)/K+ + ab + +/(?=a(*:x))(?=a(*:y)c|)/K+ + ab + +/(..)\1/ + ab\P + aba\P + abab\P + +/(..)\1/i + ab\P + abA\P + aBAb\P + +/(..)\1{2,}/ + ab\P + aba\P + abab\P + ababa\P + ababab\P + ababab\P\P + abababa\P + abababa\P\P + +/(..)\1{2,}/i + ab\P + aBa\P + aBAb\P + AbaBA\P + abABAb\P + aBAbaB\P\P + abABabA\P + abaBABa\P\P + +/(..)\1{2,}?x/i + ab\P + abA\P + aBAb\P + abaBA\P + abAbaB\P + abaBabA\P + abAbABaBx\P + +/^(..)\1/ + aba\P + +/^(..)\1{2,3}x/ + aba\P + ababa\P + ababa\P\P + abababx + ababababx + +/^(..)\1{2,3}?x/ + aba\P + ababa\P + ababa\P\P + abababx + ababababx + +/^(..)(\1{2,3})ab/ + abababab + +/^\R/ + \r\P + \r\P\P + +/^\R{2,3}x/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + \r\rx + \r\r\rx + +/^\R{2,3}?x/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + \r\rx + \r\r\rx + +/^\R?x/ + \r\P + \r\P\P + x + \rx + +/^\R+x/ + \r\P + \r\P\P + \r\n\P + \r\n\P\P + \rx + +/^a$/ + a\r\P + a\r\P\P + +/^a$/m + a\r\P + a\r\P\P + +/^(a$|a\r)/ + a\r\P + a\r\P\P + +/^(a$|a\r)/m + a\r\P + a\r\P\P + +/./ + \r\P + \r\P\P + +/.{2,3}/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + +/.{2,3}?/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + +"AB(C(D))(E(F))?(?(?=\2)(?=\4))" + ABCDGHI\O03 + +/-- These are all run as real matches in test 1; here we are just checking the +settings of the anchored and startline bits. --/ + +/(?>.*?a)(?<=ba)/I + +/(?:.*?a)(?<=ba)/I + +/.*?a(*PRUNE)b/I + +/.*?a(*PRUNE)b/sI + +/^a(*PRUNE)b/sI + +/.*?a(*SKIP)b/I + +/(?>.*?a)b/sI + +/(?>.*?a)b/I + +/(?>^a)b/sI + +/(?>.*?)(?<=(abcd)|(wxyz))/I + +/(?>.*)(?<=(abcd)|(wxyz))/I + +"(?>.*)foo"I + +"(?>.*?)foo"I + +/(?>^abc)/mI + +/(?>.*abc)/mI + +/(?:.*abc)/mI + +/-- Check PCRE_STUDY_EXTRA_NEEDED --/ + +/.?/S-I + +/.?/S!I + +/(?:(a)+(?C1)bb|aa(?C2)b)/ + aab\C+ + +/(?:(a)++(?C1)bb|aa(?C2)b)/ + aab\C+ + +/(?:(?>(a))(?C1)bb|aa(?C2)b)/ + aab\C+ + +/(?:(?1)(?C1)x|ab(?C2))((a)){0}/ + aab\C+ + +/(?1)(?C1)((a)(?C2)){0}/ + aab\C+ + +/(?:(a)+(?C1)bb|aa(?C2)b)++/ + aab\C+ + aab\C+\O2 + +/(ab)x|ab/ + ab\O3 + ab\O2 + +/(ab)/ + ab\O3 + ab\O2 + +/(?<=123)(*MARK:xx)abc/K + xxxx123a\P\P + xxxx123a\P + +/123\Kabc/ + xxxx123a\P\P + xxxx123a\P + +/^(?(?=a)aa|bb)/C + bb + +/(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/ + bb + +/-- Perl seems to have a bug with this one --/ + +/aaaaa(*COMMIT)(*PRUNE)b|a+c/ + aaaaaac + +/-- Here are some that Perl treats differently because of the way it handles +backtracking verbs. --/ + + /(?!a(*COMMIT)b)ac|ad/ + ac + ad + +/^(?!a(*THEN)b|ac)../ + ac + ad + +/^(?=a(*THEN)b|ac)/ + ac + +/\A.*?(?:a|b(*THEN)c)/ + ba + +/\A.*?(?:a|b(*THEN)c)++/ + ba + +/\A.*?(?:a|b(*THEN)c|d)/ + ba + +/(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/ + aac + +/\A.*?(a|b(*THEN)c)/ + ba + +/^(A(*THEN)B|A(*THEN)D)/ + AD + +/(?!b(*THEN)a)bn|bnn/ + bnn + +/(?(?=b(*SKIP)a)bn|bnn)/ + bnn + +/(?=b(*THEN)a|)bn|bnn/ + bnn + +/-------------------------/ + +/(*LIMIT_MATCH=12bc)abc/ + +/(*LIMIT_MATCH=4294967290)abc/ + +/(*LIMIT_RECURSION=4294967280)abc/I + +/(a+)*zz/ + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\q3000 + +/(a+)*zz/S- + aaaaaaaaaaaaaz\Q10 + +/(*LIMIT_MATCH=3000)(a+)*zz/I + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\q60000 + +/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I + aaaaaaaaaaaaaz + +/(*LIMIT_MATCH=60000)(a+)*zz/I + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\q3000 + +/(*LIMIT_RECURSION=10)(a+)*zz/IS- + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\Q1000 + +/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/IS- + aaaaaaaaaaaaaz + +/(*LIMIT_RECURSION=1000)(a+)*zz/IS- + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\Q10 + +/-- This test causes a segfault with Perl 5.18.0 --/ + +/^(?=(a)){0}b(?1)/ + backgammon + +/(?|(?f)|(?b))/JI + +/(?
abc)(?z)\k()/JDZS + +/a*[bcd]/BZ + +/[bcd]*a/BZ + +/-- A complete set of tests for auto-possessification of character types --/ + +/\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\C \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/BZx + +/\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\C \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/BZx + +/\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\C \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/BZx + +/\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\C \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/BZx + +/\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\C \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/BZx + +/\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\C \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/BZx + +/\C+\D \C+\d \C+\S \C+\s \C+\W \C+\w \C+. \C+\C \C+\R \C+\H \C+\h \C+\V \C+\v \C+\Z \C+\z \C+$/BZx + +/\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\C \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/BZx + +/\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\C \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/BZx + +/\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\C \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/BZx + +/\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\C \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/BZx + +/\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\C \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/BZx + +/ a+\D a+\d a+\S a+\s a+\W a+\w a+. a+\C a+\R a+\H a+\h a+\V a+\v a+\Z a+\z a+$/BZx + +/\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\C \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/BZx + +/ .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZx + +/ .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZxs + +/\D+$ \d+$ \S+$ \s+$ \W+$ \w+$ \C+$ \R+$ \H+$ \h+$ \V+$ \v+$ a+$ \n+$ .+$ .+$/BZxm + +/(?=a+)a(a+)++a/BZ + +/a+(bb|cc)a+(?:bb|cc)a+(?>bb|cc)a+(?:bb|cc)+a+(aa)a+(?:bb|aa)/BZ + +/a+(bb|cc)?#a+(?:bb|cc)??#a+(?:bb|cc)?+#a+(?:bb|cc)*#a+(bb|cc)?a#a+(?:aa)?/BZ + +/a+(?:bb)?a#a+(?:|||)#a+(?:|b)a#a+(?:|||)?a/BZ + +/[ab]*/BZ + aaaa + +/[ab]*?/BZ + aaaa + +/[ab]?/BZ + aaaa + +/[ab]??/BZ + aaaa + +/[ab]+/BZ + aaaa + +/[ab]+?/BZ + aaaa + +/[ab]{2,3}/BZ + aaaa + +/[ab]{2,3}?/BZ + aaaa + +/[ab]{2,}/BZ + aaaa + +/[ab]{2,}?/BZ + aaaa + +/\d+\s{0,5}=\s*\S?=\w{0,4}\W*/BZ + +/[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/BZ + +/[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/BZ + +/a+(aa|bb)*c#a*(bb|cc)*a#a?(bb|cc)*d#[a-f]*(g|hh)*f/BZ + +/[a-f]*(g|hh|i)*i#[a-x]{4,}(y{0,6})*y#[a-k]+(ll|mm)+n/BZ + +/[a-f]*(?>gg|hh)+#[a-f]*(?>gg|hh)?#[a-f]*(?>gg|hh)*a#[a-f]*(?>gg|hh)*h/BZ + +/[a-c]*d/DZS + +/[a-c]+d/DZS + +/[a-c]?d/DZS + +/[a-c]{4,6}d/DZS + +/[a-c]{0,6}d/DZS + +/-- End of special auto-possessive tests --/ + +/^A\o{1239}B/ + A\123B + +/^A\oB/ + +/^A\x{zz}B/ + +/^A\x{12Z/ + +/^A\x{/ + +/[ab]++/BZO + +/[^ab]*+/BZO + +/a{4}+/BZO + +/a{4}+/BZOi + +/[a-[:digit:]]+/ + +/[A-[:digit:]]+/ + +/[a-[.xxx.]]+/ + +/[a-[=xxx=]]+/ + +/[a-[!xxx!]]+/ + +/[A-[!xxx!]]+/ + A]]] + +/[a-\d]+/ + +/(?<0abc>xx)/ + +/(?&1abc)xx(?<1abc>y)/ + +/(?xx)/ + +/(?'0abc'xx)/ + +/(?P<0abc>xx)/ + +/\k<5ghj>/ + +/\k'5ghj'/ + +/\k{2fgh}/ + +/(?P=8yuki)/ + +/\g{4df}/ + +/(?&1abc)xx(?<1abc>y)/ + +/(?P>1abc)xx(?<1abc>y)/ + +/\g'3gh'/ + +/\g<5fg>/ + +/(?(<4gh>)abc)/ + +/(?('4gh')abc)/ + +/(?(4gh)abc)/ + +/(?(R&6yh)abc)/ + +/-- Test the ugly "start or end of word" compatibility syntax --/ + +/[[:<:]]red[[:>:]]/BZ + little red riding hood + a /red/ thing + red is a colour + put it all on red + ** Failers + no reduction + Alfred Winifred + +/[a[:<:]] should give error/ /-- End of testinput2 --/