diff options
author | nigel <nigel@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-02-24 21:39:21 +0000 |
---|---|---|
committer | nigel <nigel@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-02-24 21:39:21 +0000 |
commit | 09f9da9675b33a31c605d9d1f913bc2b05522be2 (patch) | |
tree | e4e2b0bbc47b23f497e3f1b2208a9ac9a9d4ebea /testdata | |
parent | 1622a3e7058dec7de74889c69595693ac0c64187 (diff) | |
download | pcre-09f9da9675b33a31c605d9d1f913bc2b05522be2.tar.gz |
Load pcre-3.0 into code/trunk.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@43 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/testinput2 | 115 | ||||
-rw-r--r-- | testdata/testoutput1 | 2 | ||||
-rw-r--r-- | testdata/testoutput2 | 988 | ||||
-rw-r--r-- | testdata/testoutput3 | 2 | ||||
-rw-r--r-- | testdata/testoutput4 | 10 |
5 files changed, 837 insertions, 280 deletions
diff --git a/testdata/testinput2 b/testdata/testinput2 index 5e641b2..1d9504c 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -591,5 +591,120 @@ aaaabbbbzzzz\O3 aaaabbbbzzzz\O4 aaaabbbbzzzz\O5 + +/^.?abcd/S + +/\( # ( at start + (?: # Non-capturing bracket + (?>[^()]+) # Either a sequence of non-brackets (no backtracking) + | # Or + (?R) # Recurse - i.e. nested bracketed string + )* # Zero or more contents + \) # Closing ) + /x + (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) )* \) /xg + (ab(xy)cd)pqr + 1(abcd)(x(y)z)pqr + +/\( (?: (?>[^()]+) | (?R) ) \) /x + (abcd) + (ab(xy)cd) + (a(b(c)d)e) + ((ab)) + *** Failers + () + +/\( (?: (?>[^()]+) | (?R) )? \) /x + () + 12(abcde(fsh)xyz(foo(bar))lmno)89 + +/\( ( (?>[^()]+) | (?R) )* \) /x + (ab(xy)cd) + +/\( ( ( (?>[^()]+) | (?R) )* ) \) /x + (ab(xy)cd) + +/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /x + (ab(xy)cd) + (123ab(xy)cd) + +/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /x + (ab(xy)cd) + (123ab(xy)cd) + +/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /x + (ab(xy)cd) + +/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /x + (abcd(xyz<p>qrs)123) + +/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /x + (ab(cd)ef) + (ab(cd(ef)gh)ij) + +/^[[:alnum:]]/D + +/^[[:alpha:]]/D + +/^[[:ascii:]]/D + +/^[[:cntrl:]]/D + +/^[[:digit:]]/D + +/^[[:graph:]]/D + +/^[[:lower:]]/D + +/^[[:print:]]/D + +/^[[:punct:]]/D + +/^[[:space:]]/D + +/^[[:upper:]]/D + +/^[[:xdigit:]]/D + +/^[[:word:]]/D + +/^[[:^cntrl:]]/D + +/^[12[:^digit:]]/D + +/[01[:alpha:]%]/D + +/[[.ch.]]/ + +/[[=ch=]]/ + +/[[:rhubarb:]]/ + +/[[:upper:]]/i + A + a + +/[[:lower:]]/i + A + a + +/((?-i)[[:lower:]])[[:lower:]]/i + ab + aB + *** Failers + Ab + AB / End of test input / diff --git a/testdata/testoutput1 b/testdata/testoutput1 index b53e183..1a10a74 100644 --- a/testdata/testoutput1 +++ b/testdata/testoutput1 @@ -1,4 +1,4 @@ -PCRE version 2.08 31-Aug-1999 +PCRE version 3.0 01-Feb-2000 /the quick brown fox/ the quick brown fox diff --git a/testdata/testoutput2 b/testdata/testoutput2 index aaea4b7..493f460 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -1,16 +1,16 @@ -PCRE version 2.08 31-Aug-1999 +PCRE version 3.0 01-Feb-2000 /(a)b|/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -No req char +No need char /abc/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'c' +Need char = 'c' abc 0: abc defabc @@ -25,10 +25,10 @@ No match No match /^abc/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored No first char -Req char = 'c' +Need char = 'c' abc 0: abc \Aabc @@ -41,34 +41,34 @@ No match No match /a+bc/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'c' +Need char = 'c' /a*bc/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -Req char = 'c' +Need char = 'c' /a{3}bc/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'c' +Need char = 'c' /(abc|a+z)/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options First char = 'a' -No req char +No need char /^abc$/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored No first char -Req char = 'c' +Need char = 'c' abc 0: abc *** Failers @@ -113,32 +113,32 @@ Failed: missing ) after comment at offset 7 Failed: unrecognized character after (? at offset 2 /.*b/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char at start or follows \n -Req char = 'b' +Need char = 'b' /.*?b/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char at start or follows \n -Req char = 'b' +Need char = 'b' /cat|dog|elephant/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char this sentence eventually mentions a cat 0: cat this sentences rambles on and on for a while and then reaches elephant 0: elephant /cat|dog|elephant/S -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char Starting character set: c d e this sentence eventually mentions a cat 0: cat @@ -146,10 +146,10 @@ Starting character set: c d e 0: elephant /cat|dog|elephant/iS -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: caseless No first char -No req char +No need char Starting character set: C D E c d e this sentence eventually mentions a CAT cat 0: CAT @@ -157,17 +157,17 @@ Starting character set: C D E c d e 0: elephant /a|[bcd]/S -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char Starting character set: a b c d /(a|[^\dZ])/S -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -No req char +No need char Starting character set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = > @@ -184,10 +184,10 @@ Starting character set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a \xfc \xfd \xfe \xff /(a|b)*[\s]/S -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -No req char +No need char Starting character set: \x09 \x0a \x0b \x0c \x0d \x20 a b /(ab\2)/ @@ -197,10 +197,11 @@ Failed: back reference to non-existent subpattern at offset 6 Failed: nothing to repeat at offset 4 /(a)(b)(c)\2/ -Identifying subpattern count = 3 +Capturing subpattern count = 3 +Max back reference = 2 No options First char = 'a' -Req char = 'c' +Need char = 'c' abcb 0: abcb 1: a @@ -227,10 +228,11 @@ Matched, but too many substrings 3: c /(a)bc|(a)(b)\2/ -Identifying subpattern count = 3 +Capturing subpattern count = 3 +Max back reference = 2 No options First char = 'a' -No req char +No need char abc 0: abc 1: a @@ -268,10 +270,10 @@ Matched, but too many substrings 3: b /abc$/E -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: dollar_endonly First char = 'a' -Req char = 'c' +Need char = 'c' abc 0: abc *** Failers @@ -285,20 +287,20 @@ No match Failed: back reference to non-existent subpattern at offset 17 /the quick brown fox/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 't' -Req char = 'x' +Need char = 'x' the quick brown fox 0: the quick brown fox this is a line with the quick brown fox 0: the quick brown fox /the quick brown fox/A -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored No first char -Req char = 'x' +Need char = 'x' the quick brown fox 0: the quick brown fox *** Failers @@ -310,20 +312,20 @@ No match Failed: unrecognized character after (? at offset 4 /^abc|def/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char abcdef 0: abc abcdef\B 0: def /.*((abc)$|(def))/ -Identifying subpattern count = 3 +Capturing subpattern count = 3 No options First char at start or follows \n -No req char +No need char defabc 0: defabc 1: abc @@ -396,74 +398,74 @@ Failed: unmatched parentheses at offset 0 Failed: missing terminating ] for character class at offset 4 /[^aeiou ]{3,}/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char co-processors, and for 0: -pr /<.*>/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = '<' -Req char = '>' +Need char = '>' abc<def>ghi<klm>nop 0: <def>ghi<klm> /<.*?>/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = '<' -Req char = '>' +Need char = '>' abc<def>ghi<klm>nop 0: <def> /<.*>/U -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: ungreedy First char = '<' -Req char = '>' +Need char = '>' abc<def>ghi<klm>nop 0: <def> /<.*>(?U)/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: ungreedy First char = '<' -Req char = '>' +Need char = '>' abc<def>ghi<klm>nop 0: <def> /<.*?>/U -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: ungreedy First char = '<' -Req char = '>' +Need char = '>' abc<def>ghi<klm>nop 0: <def>ghi<klm> /={3,}/U -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: ungreedy First char = '=' -Req char = '=' +Need char = '=' abc========def 0: === /(?U)={3,}?/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: ungreedy First char = '=' -Req char = '=' +Need char = '=' abc========def 0: ======== /(?<!bar|cattle)foo/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'f' -Req char = 'o' +Need char = 'o' foo 0: foo catfoo @@ -485,68 +487,68 @@ Failed: lookbehind assertion is not fixed length at offset 14 Failed: lookbehind assertion is not fixed length at offset 12 /(?i)abc/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: caseless First char = 'a' -Req char = 'c' +Need char = 'c' /(a|(?m)a)/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options First char = 'a' -No req char +No need char /(?i)^1234/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored caseless No first char -Req char = '4' +Need char = '4' /(^b|(?i)^d)/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 Options: anchored Case state changes No first char -No req char +No need char /(?s).*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored dotall No first char -No req char +No need char /[abcd]/S -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char Starting character set: a b c d /(?i)[abcd]/S -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: caseless No first char -No req char +No need char Starting character set: A B C D a b c d /(?m)[xy]|(b|c)/S -Identifying subpattern count = 1 +Capturing subpattern count = 1 Options: multiline No first char -No req char +No need char Starting character set: b c x y /(^a|^b)/m -Identifying subpattern count = 1 +Capturing subpattern count = 1 Options: multiline First char at start or follows \n -No req char +No need char /(?i)(^a|^b)/m -Identifying subpattern count = 1 +Capturing subpattern count = 1 Options: caseless multiline First char at start or follows \n -No req char +No need char /(a)(?(1)a|b|c)/ Failed: conditional group contains more than two branches at offset 13 @@ -567,17 +569,19 @@ Failed: assertion expected after (?( at offset 3 Failed: unrecognized character after (?< at offset 2 /((?s)blah)\s+\1/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 +Max back reference = 1 No options First char = 'b' -Req char = 'h' +Need char = 'h' /((?i)blah)\s+\1/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 +Max back reference = 1 No options Case state changes No first char -Req char = 'h' +Need char = 'h' /((?i)b)/DS ------------------------------------------------------------------ @@ -590,26 +594,26 @@ Req char = 'h' 16 16 Ket 19 End ------------------------------------------------------------------ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options Case state changes No first char -Req char = 'b' +Need char = 'b' Starting character set: B b /(a*b|(?i:c*(?-i)d))/S -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options Case state changes No first char -No req char +No need char Starting character set: C a b c d /a$/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char a 0: a a\n @@ -622,10 +626,10 @@ No match No match /a$/m -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: multiline First char = 'a' -No req char +No need char a 0: a a\n @@ -638,22 +642,22 @@ No match No match /\Aabc/m -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored multiline No first char -Req char = 'c' +Need char = 'c' /^abc/m -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: multiline First char at start or follows \n -Req char = 'c' +Need char = 'c' /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/ -Identifying subpattern count = 5 +Capturing subpattern count = 5 Options: anchored No first char -Req char = 'a' +Need char = 'a' aaaaabbbbbcccccdef 0: aaaaabbbbbcccccdef 1: aaaaabbbbbcccccdef @@ -663,37 +667,37 @@ Req char = 'a' 5: def /(?<=foo)[ab]/S -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char Starting character set: a b /(?<!foo)(alpha|omega)/S -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -Req char = 'a' +Need char = 'a' Starting character set: a o /(?!alphabet)[ab]/S -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char Starting character set: a b /(?<=foo\n)^bar/m -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: multiline First char at start or follows \n -Req char = 'r' +Need char = 'r' /(?>^abc)/m -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: multiline First char at start or follows \n -Req char = 'c' +Need char = 'c' abc 0: abc def\nabc @@ -713,16 +717,16 @@ Failed: lookbehind assertion is not fixed length at offset 12 Failed: lookbehind assertion is not fixed length at offset 13 /The next three are in testinput2 because they have variable length branches/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'T' -Req char = 's' +Need char = 's' /(?<=bullock|donkey)-cart/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = '-' -Req char = 't' +Need char = 't' the bullock-cart 0: -cart a donkey-cart race @@ -735,17 +739,17 @@ No match No match /(?<=ab(?i)x|y|z)/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options Case state changes No first char -No req char +No need char /(?>.*)(?<=(abcd)|(xyz))/ -Identifying subpattern count = 2 +Capturing subpattern count = 2 No options First char at start or follows \n -No req char +No need char alphabetabcd 0: alphabetabcd 1: abcd @@ -755,11 +759,11 @@ No req char 2: xyz /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options Case state changes First char = 'Z' -Req char = 'Z' +Need char = 'Z' abxyZZ 0: ZZ abXyZZ @@ -784,10 +788,10 @@ No match No match /(?<!(foo)a)bar/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options First char = 'b' -Req char = 'r' +Need char = 'r' bar 0: bar foobbar @@ -798,41 +802,42 @@ No match No match /This one is here because Perl 5.005_02 doesn't fail it/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'T' -Req char = 't' +Need char = 't' /^(a)?(?(1)a|b)+$/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 Options: anchored No first char -No req char +No need char *** Failers No match a No match /This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'T' -Req char = 'g' +Need char = 'g' /^(a\1?){4}$/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 +Max back reference = 1 Options: anchored No first char -Req char = 'a' +Need char = 'a' aaaaaa 0: aaaaaa 1: aa /These are syntax tests from Perl 5.005/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'T' -Req char = '5' +Need char = '5' /a[b-a]/ Failed: range out of order in character class at offset 4 @@ -943,10 +948,10 @@ Failed: POSIX code 9: bad escape sequence at offset 4 Failed: \ at end of pattern at offset 4 /(a)bc(d)/ -Identifying subpattern count = 2 +Capturing subpattern count = 2 No options First char = 'a' -Req char = 'd' +Need char = 'd' abcd 0: abcd 1: a @@ -963,10 +968,10 @@ Req char = 'd' copy substring 5 failed -7 /(.{20})/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -No req char +No need char abcdefghijklmnopqrstuvwxyz 0: abcdefghijklmnopqrst 1: abcdefghijklmnopqrst @@ -980,10 +985,10 @@ copy substring 1 failed -6 1G abcdefghijklmnopqrst (20) /(.{15})/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -No req char +No need char abcdefghijklmnopqrstuvwxyz 0: abcdefghijklmno 1: abcdefghijklmno @@ -994,10 +999,10 @@ No req char 1G abcdefghijklmno (15) /(.{16})/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -No req char +No need char abcdefghijklmnopqrstuvwxyz 0: abcdefghijklmnop 1: abcdefghijklmnop @@ -1010,10 +1015,10 @@ copy substring 1 failed -6 1L abcdefghijklmnop /^(a|(bc))de(f)/ -Identifying subpattern count = 3 +Capturing subpattern count = 3 Options: anchored No first char -Req char = 'f' +Need char = 'f' adef\G1\G2\G3\G4\L 0: adef 1: a @@ -1048,10 +1053,10 @@ get substring 4 failed -7 0C adef (4) /^abc\00def/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored No first char -Req char = 'f' +Need char = 'f' abc\00def\L\C0 0: abc\x00def 0C abc (7) @@ -1061,10 +1066,10 @@ Req char = 'f' )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )?)?)?)?)?)?)?)?)?otherword/M Memory allocation (code space): 428 -Identifying subpattern count = 8 +Capturing subpattern count = 8 No options First char = 'w' -Req char = 'd' +Need char = 'd' /.*X/D ------------------------------------------------------------------ @@ -1074,10 +1079,10 @@ Req char = 'd' 8 8 Ket 11 End ------------------------------------------------------------------ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char at start or follows \n -Req char = 'X' +Need char = 'X' /.*X/Ds ------------------------------------------------------------------ @@ -1087,10 +1092,10 @@ Req char = 'X' 8 8 Ket 11 End ------------------------------------------------------------------ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored dotall No first char -Req char = 'X' +Need char = 'X' /(.*X|^B)/D ------------------------------------------------------------------ @@ -1105,10 +1110,10 @@ Req char = 'X' 21 21 Ket 24 End ------------------------------------------------------------------ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options First char at start or follows \n -No req char +No need char /(.*X|^B)/Ds ------------------------------------------------------------------ @@ -1123,10 +1128,10 @@ No req char 21 21 Ket 24 End ------------------------------------------------------------------ -Identifying subpattern count = 1 +Capturing subpattern count = 1 Options: anchored dotall No first char -No req char +No need char /(?s)(.*X|^B)/D ------------------------------------------------------------------ @@ -1141,10 +1146,10 @@ No req char 21 21 Ket 24 End ------------------------------------------------------------------ -Identifying subpattern count = 1 +Capturing subpattern count = 1 Options: anchored dotall No first char -No req char +No need char /(?s:.*X|^B)/D ------------------------------------------------------------------ @@ -1162,16 +1167,16 @@ No req char 27 27 Ket 30 End ------------------------------------------------------------------ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char at start or follows \n -No req char +No need char /\Biss\B/+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'i' -Req char = 's' +Need char = 's' Mississippi 0: iss 0+ issippi @@ -1182,10 +1187,10 @@ Req char = 's' 0+ issippi /iss/G+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'i' -Req char = 's' +Need char = 's' Mississippi 0: iss 0+ issippi @@ -1193,19 +1198,19 @@ Req char = 's' 0+ ippi /\Biss\B/G+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'i' -Req char = 's' +Need char = 's' Mississippi 0: iss 0+ issippi /\Biss\B/g+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'i' -Req char = 's' +Need char = 's' Mississippi 0: iss 0+ issippi @@ -1217,10 +1222,10 @@ No match No match /(?<=[Ms])iss/g+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'i' -Req char = 's' +Need char = 's' Mississippi 0: iss 0+ issippi @@ -1228,28 +1233,28 @@ Req char = 's' 0+ ippi /(?<=[Ms])iss/G+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'i' -Req char = 's' +Need char = 's' Mississippi 0: iss 0+ issippi /^iss/g+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored No first char -Req char = 's' +Need char = 's' ississippi 0: iss 0+ issippi /.*iss/g+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char at start or follows \n -Req char = 's' +Need char = 's' abciss\nxyzisspqr 0: abciss 0+ \x0axyzisspqr @@ -1257,10 +1262,10 @@ Req char = 's' 0+ pqr /.i./+g -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -Req char = 'i' +Need char = 'i' Mississippi 0: Mis 0+ sissippi @@ -1287,28 +1292,28 @@ Req char = 'i' 0+ souri river /^.is/+g -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored No first char -Req char = 's' +Need char = 's' Mississippi 0: Mis 0+ sissippi /^ab\n/g+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: anchored No first char -Req char = 10 +Need char = 10 ab\nab\ncd 0: ab\x0a 0+ ab\x0acd /^ab\n/mg+ -Identifying subpattern count = 0 +Capturing subpattern count = 0 Options: multiline First char at start or follows \n -Req char = 10 +Need char = 10 ab\nab\ncd 0: ab\x0a 0+ ab\x0acd @@ -1316,256 +1321,256 @@ Req char = 10 0+ cd /abc/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'c' +Need char = 'c' /abc|bac/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -Req char = 'c' +Need char = 'c' /(abc|bac)/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -Req char = 'c' +Need char = 'c' /(abc|(c|dc))/ -Identifying subpattern count = 2 +Capturing subpattern count = 2 No options No first char -Req char = 'c' +Need char = 'c' /(abc|(d|de)c)/ -Identifying subpattern count = 2 +Capturing subpattern count = 2 No options No first char -Req char = 'c' +Need char = 'c' /a*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char /a+/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char /(baa|a+)/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -Req char = 'a' +Need char = 'a' /a{0,3}/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char /baa{3,}/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'b' -Req char = 'a' +Need char = 'a' /"([^\\"]+|\\.)*"/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options First char = '"' -Req char = '"' +Need char = '"' /(abc|ab[cd])/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options First char = 'a' -No req char +No need char /(a|.)/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -No req char +No need char /a|ba|\w/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char /abc(?=pqr)/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'r' +Need char = 'r' /...(?<=abc)/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char /abc(?!pqr)/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'c' +Need char = 'c' /ab./ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'b' +Need char = 'b' /ab[xyz]/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'b' +Need char = 'b' /abc*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'b' +Need char = 'b' /ab.c*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'b' +Need char = 'b' /a.c*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char /.c*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char /ac*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char /(a.c*|b.c*)/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options No first char -No req char +No need char /a.c*|aba/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char /.+a/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -Req char = 'a' +Need char = 'a' /(?=abcda)a.*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char /(?=a)a.*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char /a(b)*/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options First char = 'a' -No req char +No need char /a\d*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char /ab\d*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'b' +Need char = 'b' /a(\d)*/ -Identifying subpattern count = 1 +Capturing subpattern count = 1 No options First char = 'a' -No req char +No need char /abcde{0,0}/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'd' +Need char = 'd' /ab\d+/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'b' +Need char = 'b' /a(?(1)b)/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char /a(?(1)bag|big)/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'g' +Need char = 'g' /a(?(1)bag|big)*/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -No req char +No need char /a(?(1)bag|big)+/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'g' +Need char = 'g' /a(?(1)b..|b..)/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'b' +Need char = 'b' /ab\d{0}e/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = 'a' -Req char = 'e' +Need char = 'e' /a?b?/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char a 0: a b @@ -1580,10 +1585,10 @@ No req char No match /|-/ -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char abcd 0: -abc @@ -1621,10 +1626,447 @@ No match 1: bbbb 2: z 3: z + +/^.?abcd/S +Capturing subpattern count = 0 +Options: anchored +No first char +Need char = 'd' +Study returned NULL + +/\( # ( at start + (?: # Non-capturing bracket + (?>[^()]+) # Either a sequence of non-brackets (no backtracking) + | # Or + (?R) # Recurse - i.e. nested bracketed string + )* # Zero or more contents + \) # Closing ) + /x +Capturing subpattern count = 0 +Options: extended +First char = '(' +Need char = ')' + (abcd) + 0: (abcd) + (abcd)xyz + 0: (abcd) + xyz(abcd) + 0: (abcd) + (ab(xy)cd)pqr + 0: (ab(xy)cd) + (ab(xycd)pqr + 0: (xycd) + () abc () + 0: () + 12(abcde(fsh)xyz(foo(bar))lmno)89 + 0: (abcde(fsh)xyz(foo(bar))lmno) + *** Failers +No match + abcd +No match + abcd) +No match + (abcd +No match + +/\( ( (?>[^()]+) | (?R) )* \) /xg +Capturing subpattern count = 1 +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd)pqr + 0: (ab(xy)cd) + 1: cd + 1(abcd)(x(y)z)pqr + 0: (abcd) + 1: abcd + 0: (x(y)z) + 1: z + +/\( (?: (?>[^()]+) | (?R) ) \) /x +Capturing subpattern count = 0 +Options: extended +First char = '(' +Need char = ')' + (abcd) + 0: (abcd) + (ab(xy)cd) + 0: (xy) + (a(b(c)d)e) + 0: (c) + ((ab)) + 0: ((ab)) + *** Failers +No match + () +No match + +/\( (?: (?>[^()]+) | (?R) )? \) /x +Capturing subpattern count = 0 +Options: extended +First char = '(' +Need char = ')' + () + 0: () + 12(abcde(fsh)xyz(foo(bar))lmno)89 + 0: (fsh) + +/\( ( (?>[^()]+) | (?R) )* \) /x +Capturing subpattern count = 1 +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: cd + +/\( ( ( (?>[^()]+) | (?R) )* ) \) /x +Capturing subpattern count = 2 +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: ab(xy)cd + 2: cd + +/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /x +Capturing subpattern count = 3 +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: <unset> + 2: ab(xy)cd + 3: cd + (123ab(xy)cd) + 0: (123ab(xy)cd) + 1: 123 + 2: ab(xy)cd + 3: cd + +/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /x +Capturing subpattern count = 3 +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: ab(xy)cd + 2: <unset> + 3: cd + (123ab(xy)cd) + 0: (123ab(xy)cd) + 1: 123ab(xy)cd + 2: 123 + 3: cd + +/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /x +Capturing subpattern count = 11 +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: ab(xy)cd + 2: ab(xy)cd + 3: ab(xy)cd + 4: ab(xy)cd + 5: ab(xy)cd + 6: ab(xy)cd + 7: ab(xy)cd + 8: ab(xy)cd + 9: ab(xy)cd +10: ab(xy)cd +11: cd + +/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /x +Capturing subpattern count = 3 +Options: extended +First char = '(' +Need char = ')' + (abcd(xyz<p>qrs)123) + 0: (abcd(xyz<p>qrs)123) + 1: abcd(xyz<p>qrs)123 + 2: 123 + 3: <p>qrs + +/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /x +Capturing subpattern count = 3 +Options: extended +First char = '(' +Need char = ')' + (ab(cd)ef) + 0: (ab(cd)ef) + 1: ab(cd)ef + 2: ef + 3: (cd) + (ab(cd(ef)gh)ij) + 0: (ab(cd(ef)gh)ij) + 1: ab(cd(ef)gh)ij + 2: ij + 3: (cd(ef)gh) + +/^[[:alnum:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [0-9A-Za-z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:alpha:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [A-Za-z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:ascii:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-\x7f] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:cntrl:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-\x1f\x7f] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:digit:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [0-9] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:graph:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [!-~] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:lower:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [a-z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:print:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [ -~] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:punct:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [!-/:-@[-`{-~] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:space:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x09-\x0d ] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:upper:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [A-Z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:xdigit:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [0-9A-Fa-f] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:word:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [0-9A-Z_a-z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:^cntrl:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [ -~\x80-\xff] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[12[:^digit:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-/1-2:-\xff] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/[01[:alpha:]%]/D +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [%0-1A-Za-z] + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[[.ch.]]/ +Failed: POSIX collating elements are not supported at offset 1 + +/[[=ch=]]/ +Failed: POSIX collating elements are not supported at offset 1 + +/[[:rhubarb:]]/ +Failed: unknown POSIX class name at offset 3 + +/[[:upper:]]/i +Capturing subpattern count = 0 +Options: caseless +No first char +No need char + A + 0: A + a + 0: a + +/[[:lower:]]/i +Capturing subpattern count = 0 +Options: caseless +No first char +No need char + A + 0: A + a + 0: a + +/((?-i)[[:lower:]])[[:lower:]]/i +Capturing subpattern count = 1 +Options: caseless +Case state changes +No first char +No need char + ab + 0: ab + 1: a + aB + 0: aB + 1: a + *** Failers + 0: ai + 1: a + Ab +No match + AB +No match / End of test input / -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options First char = ' ' -Req char = ' ' +Need char = ' ' diff --git a/testdata/testoutput3 b/testdata/testoutput3 index d997659..a4a28c1 100644 --- a/testdata/testoutput3 +++ b/testdata/testoutput3 @@ -1,4 +1,4 @@ -PCRE version 2.08 31-Aug-1999 +PCRE version 3.0 01-Feb-2000 /(?<!bar)foo/ foo diff --git a/testdata/testoutput4 b/testdata/testoutput4 index c8af6cf..586cbbd 100644 --- a/testdata/testoutput4 +++ b/testdata/testoutput4 @@ -1,4 +1,4 @@ -PCRE version 2.08 31-Aug-1999 +PCRE version 3.0 01-Feb-2000 /^[\w]+/ *** Failers @@ -81,18 +81,18 @@ No match 0: école /\w/IS -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char Starting character set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z /\w/ISLfr -Identifying subpattern count = 0 +Capturing subpattern count = 0 No options No first char -No req char +No need char Starting character set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å |