--- embedaddon/pcre/testdata/testinput1 2012/10/09 09:19:18 1.1.1.3 +++ embedaddon/pcre/testdata/testinput1 2013/07/22 08:25:57 1.1.1.4 @@ -3773,9 +3773,9 @@ abc123abc abc123bc -/-- This tests for an IPv6 address in the form where it can have up to --/ -/-- eight components, one and only one of which is empty. This must be --/ -/-- an internal component. --/ +/-- This tests for an IPv6 address in the form where it can have up to + eight components, one and only one of which is empty. This must be + an internal component. --/ /^(?!:) # colon disallowed at start (?: # start of item @@ -4656,16 +4656,10 @@ /(? \( ( [^()]++ | (?&pn) )* \) )/x (ab(cd)ef) -/^(?!a(*SKIP)b)/ - ac - /^(?=a(*SKIP)b|ac)/ ** Failers ac -/^(?=a(*THEN)b|ac)/ - ac - /^(?=a(*PRUNE)b)/ ab ** Failers @@ -4674,9 +4668,6 @@ /^(?=a(*ACCEPT)b)/ ac -/^(?(?!a(*SKIP)b))/ - ac - /(?>a\Kb)/ ab @@ -4899,33 +4890,15 @@ however, we need the complication for Perl. ---/ /(A (A|B(*ACCEPT)|C) D)(E)/x AB -/\A.*?(?:a|b(*THEN)c)/ - ba - -/\A.*?(?:a|bc)/ - ba - -/\A.*?(a|b(*THEN)c)/ - ba - /\A.*?(a|bc)/ ba -/\A.*?(?:a|b(*THEN)c)++/ - ba - /\A.*?(?:a|bc)++/ ba -/\A.*?(a|b(*THEN)c)++/ - ba - /\A.*?(a|bc)++/ ba -/\A.*?(?:a|b(*THEN)c|d)/ - ba - /\A.*?(?:a|bc|d)/ ba @@ -5253,13 +5226,386 @@ name were given. ---/ /(a(*COMMIT)b){0}a(?1)|aac/ aac -/(?!a(*COMMIT)b)ac|cd/ - ac - /((?:a?)*)*c/ aac /((?>a?)*)*c/ aac + +/(?>.*?a)(?<=ba)/ + aba + +/(?:.*?a)(?<=ba)/ + aba + +/.*?a(*PRUNE)b/ + aab + +/.*?a(*PRUNE)b/s + aab + +/^a(*PRUNE)b/s + aab + +/.*?a(*SKIP)b/ + aab + +/(?>.*?a)b/s + aab + +/(?>.*?a)b/ + aab + +/(?>^a)b/s + aab + +/(?>.*?)(?<=(abcd)|(wxyz))/ + alphabetabcd + endingwxyz + +/(?>.*)(?<=(abcd)|(wxyz))/ + alphabetabcd + endingwxyz + +"(?>.*)foo" + abcdfooxyz + +"(?>.*?)foo" + abcdfooxyz + +/(?:(a(*PRUNE)b)){0}(?:(?1)|ac)/ + ac + +/(?:(a(*SKIP)b)){0}(?:(?1)|ac)/ + ac + +/(?<=(*SKIP)ac)a/ + aa + +/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK + AAAC + +/a(*SKIP:m)x|ac(*:n)(*SKIP:n)d|ac/K + acacd + +/A(*SKIP:m)x|A(*SKIP:n)x|AB/K + AB + +/((*SKIP:r)d){0}a(*SKIP:m)x|ac(*:n)|ac/K + acacd + +/-- Tests that try to figure out how Perl works. My hypothesis is that the + first verb that is backtracked onto is the one that acts. This seems to be + the case almost all the time, but there is one exception that is perhaps a + bug. --/ + +/-- This matches "aaaac"; each PRUNE advances one character until the subject + no longer starts with 5 'a's. --/ + +/aaaaa(*PRUNE)b|a+c/ + aaaaaac + +/-- Putting SKIP in front of PRUNE makes no difference, as it is never +backtracked onto, whether or not it has a label. --/ + +/aaaaa(*SKIP)(*PRUNE)b|a+c/ + aaaaaac + +/aaaaa(*SKIP:N)(*PRUNE)b|a+c/ + aaaaaac + +/aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c/ + aaaaaac + +/-- Putting THEN in front makes no difference. */ + +/aaaaa(*THEN)(*PRUNE)b|a+c/ + aaaaaac + +/-- However, putting COMMIT in front of the prune changes it to "no match". I + think this is inconsistent and possibly a bug. For the moment, running this + test is moved out of the Perl-compatible file. --/ + +/aaaaa(*COMMIT)(*PRUNE)b|a+c/ + + +/---- OK, lets play the same game again using SKIP instead of PRUNE. ----/ + +/-- This matches "ac" because SKIP forces the next match to start on the + sixth "a". --/ + +/aaaaa(*SKIP)b|a+c/ + aaaaaac + +/-- Putting PRUNE in front makes no difference. --/ + +/aaaaa(*PRUNE)(*SKIP)b|a+c/ + aaaaaac + +/-- Putting THEN in front makes no difference. --/ + +/aaaaa(*THEN)(*SKIP)b|a+c/ + aaaaaac + +/-- In this case, neither does COMMIT. This still matches "ac". --/ + +/aaaaa(*COMMIT)(*SKIP)b|a+c/ + aaaaaac + +/-- This gives "no match", as expected. --/ + +/aaaaa(*COMMIT)b|a+c/ + aaaaaac + + +/------ Tests using THEN ------/ + +/-- This matches "aaaaaac", as expected. --/ + +/aaaaa(*THEN)b|a+c/ + aaaaaac + +/-- Putting SKIP in front makes no difference. --/ + +/aaaaa(*SKIP)(*THEN)b|a+c/ + aaaaaac + +/-- Putting PRUNE in front makes no difference. --/ + +/aaaaa(*PRUNE)(*THEN)b|a+c/ + aaaaaac + +/-- Putting COMMIT in front makes no difference. --/ + +/aaaaa(*COMMIT)(*THEN)b|a+c/ + aaaaaac + +/-- End of "priority" tests --/ + +/aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+/ + aaaaaa + +/aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/ + aaaaaa + +/aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+/ + aaaaaa + +/aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/ + aaaaaa + +/a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c/ + aaaac + +/a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c/ + aaaac + +/aaa(*PRUNE:A)a(*SKIP:A)b|a+c/ + aaaac + +/aaa(*MARK:A)a(*SKIP:A)b|a+c/ + aaaac + +/a(*:m)a(*COMMIT)(*SKIP:m)b|a+c/K + aaaaaac + +/.?(a|b(*THEN)c)/ + ba + +/(a(*COMMIT)b)c|abd/ + abc + abd + +/(?=a(*COMMIT)b)abc|abd/ + abc + abd + +/(?>a(*COMMIT)b)c|abd/ + abc + abd + +/a(?=b(*COMMIT)c)[^d]|abd/ + abd + abc + +/a(?=bc).|abd/ + abd + abc + +/a(?>b(*COMMIT)c)d|abd/ + abceabd + +/a(?>bc)d|abd/ + abceabd + +/(?>a(*COMMIT)b)c|abd/ + abd + +/(?>a(*COMMIT)c)d|abd/ + abd + +/((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/ + ac + +/-- These tests were formerly in test 2, but changes in PCRE and Perl have + made them compatible. --/ + +/^(a)?(?(1)a|b)+$/ + *** Failers + a + +/(?=a\Kb)ab/ + ab + +/(?!a\Kb)ac/ + ac + +/^abc(?<=b\Kc)d/ + abcd + +/^abc(?b))/K + abc + +/(*PRUNE:m(m)(?&y)(?(DEFINE)(?b))/K + abc + +/(*SKIP:m(m)(?&y)(?(DEFINE)(?b))/K + abc + +/(*THEN:m(m)(?&y)(?(DEFINE)(?b))/K + abc + +/^\d*\w{4}/ + 1234 + 123 + +/^[^b]*\w{4}/ + aaaa + aaa + +/^[^b]*\w{4}/i + aaaa + aaa + +/^a*\w{4}/ + aaaa + aaa + +/^a*\w{4}/i + aaaa + aaa /-- End of testinput1 --/