diff options
Diffstat (limited to 'testdata/testoutput2')
-rw-r--r-- | testdata/testoutput2 | 2695 |
1 files changed, 2038 insertions, 657 deletions
diff --git a/testdata/testoutput2 b/testdata/testoutput2 index 01cb193..fcaac8f 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -1,12 +1,12 @@ # This set of tests is not Perl-compatible. It checks on special features # of PCRE2's API, error diagnostics, and the compiled code of some patterns. -# It also checks the non-Perl syntax that PCRE2 supports (Python, .NET, -# Oniguruma). There are also some tests where PCRE2 and Perl differ, -# either because PCRE2 can't be compatible, or there is a possible Perl +# It also checks the non-Perl syntax that PCRE2 supports (Python, .NET, +# Oniguruma). There are also some tests where PCRE2 and Perl differ, +# either because PCRE2 can't be compatible, or there is a possible Perl # bug. # NOTE: This is a non-UTF set of tests. When UTF support is needed, use -# test 5. +# test 5. #forbid_utf #newline_default lf any anycrlf @@ -72,6 +72,7 @@ No match Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 3 abc 0: abc @@ -110,6 +111,7 @@ Subject length lower bound = 2 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 3 abc 0: abc @@ -339,6 +341,7 @@ Subject length lower bound = 19 /the quick brown fox/I,anchored Capturing subpattern count = 0 Options: anchored +First code unit = 't' Subject length lower bound = 19 the quick brown fox 0: the quick brown fox @@ -351,6 +354,7 @@ Failed: error 111 at offset 4: unrecognized character after (? or (?- /^abc|def/I Capturing subpattern count = 0 +Starting code units: a d Subject length lower bound = 3 abcdef 0: abc @@ -472,14 +476,13 @@ No match and cattlefoo No match -/(?<=a+)b/ -Failed: error 125 at offset 6: lookbehind assertion is not fixed length +/abc(?<=a+)b/ +Failed: error 125 at offset 3: lookbehind assertion is not fixed length -/(?<=aaa|b{0,3})b/ -Failed: error 125 at offset 14: lookbehind assertion is not fixed length +/12345(?<=aaa|b{0,3})b/ +Failed: error 125 at offset 5: lookbehind assertion is not fixed length /(?<!(foo)a\1)bar/ -Failed: error 125 at offset 12: lookbehind assertion is not fixed length /(?i)abc/I Capturing subpattern count = 0 @@ -496,12 +499,14 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = '1' Subject length lower bound = 4 /(^b|(?i)^d)/I Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +Starting code units: D b d Subject length lower bound = 1 /(?s).*/I @@ -539,25 +544,25 @@ First code unit at start or follows newline Subject length lower bound = 1 /(a)(?(1)a|b|c)/ -Failed: error 127 at offset 13: conditional group contains more than two branches +Failed: error 127 at offset 3: conditional group contains more than two branches /(?(?=a)a|b|c)/ -Failed: error 127 at offset 12: conditional group contains more than two branches +Failed: error 127 at offset 0: conditional group contains more than two branches /(?(1a)/ -Failed: error 114 at offset 6: missing closing parenthesis +Failed: error 124 at offset 4: missing closing parenthesis for condition /(?(1a))/ -Failed: error 126 at offset 4: malformed number or name after (?( +Failed: error 124 at offset 4: missing closing parenthesis for condition /(?(?i))/ -Failed: error 128 at offset 3: assertion expected after (?( or (?(?C) +Failed: error 128 at offset 2: assertion expected after (?( or (?(?C) /(?(abc))/ -Failed: error 115 at offset 7: reference to non-existent subpattern +Failed: error 115 at offset 3: reference to non-existent subpattern /(?(?<ab))/ -Failed: error 128 at offset 3: assertion expected after (?( or (?(?C) +Failed: error 128 at offset 2: assertion expected after (?( or (?(?C) /((?s)blah)\s+\1/I Capturing subpattern count = 1 @@ -625,6 +630,7 @@ Capturing subpattern count = 0 Max lookbehind = 1 Compile options: multiline Overall options: anchored multiline +First code unit = 'a' Subject length lower bound = 3 /^abc/Im @@ -638,6 +644,7 @@ Subject length lower bound = 3 Capturing subpattern count = 5 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 3 aaaaabbbbbcccccdef 0: aaaaabbbbbcccccdef @@ -715,13 +722,13 @@ Subject length lower bound = 3 No match /(?<=ab(c+)d)ef/ -Failed: error 125 at offset 11: lookbehind assertion is not fixed length +Failed: error 125 at offset 0: lookbehind assertion is not fixed length /(?<=ab(?<=c+)d)ef/ -Failed: error 125 at offset 12: lookbehind assertion is not fixed length +Failed: error 125 at offset 6: lookbehind assertion is not fixed length /(?<=ab(c|de)f)g/ -Failed: error 125 at offset 13: lookbehind assertion is not fixed length +Failed: error 125 at offset 0: lookbehind assertion is not fixed length /The next three are in testinput2 because they have variable length branches/ @@ -809,13 +816,14 @@ Capturing subpattern count = 1 Max back reference = 1 Compile options: <none> Overall options: anchored +Starting code units: a Subject length lower bound = 4 \= Expect no match aaaa No match aaaaaa No match - + # Perl does not fail these two for the final subjects. Neither did PCRE until # release 8.01. The problem is in backtracking into a subpattern that contains # a recursive reference to itself. PCRE has now made these into atomic patterns. @@ -905,7 +913,7 @@ Failed: error 122 at offset 0: unmatched closing parenthesis Failed: error 114 at offset 4: missing closing parenthesis /(?<%)b/ -Failed: error 124 at offset 3: letter or underscore expected after (?< or (?' +Failed: error 162 at offset 3: subpattern name expected /a(?{)b/ Failed: error 111 at offset 3: unrecognized character after (? or (?- @@ -923,22 +931,22 @@ Failed: error 111 at offset 3: unrecognized character after (? or (?- Failed: error 111 at offset 3: unrecognized character after (? or (?- /(?(1?)a|b)/ -Failed: error 126 at offset 4: malformed number or name after (?( +Failed: error 124 at offset 4: missing closing parenthesis for condition /[a[:xyz:/ Failed: error 106 at offset 8: missing terminating ] for character class /(?<=x+)y/ -Failed: error 125 at offset 6: lookbehind assertion is not fixed length +Failed: error 125 at offset 0: lookbehind assertion is not fixed length /a{37,17}/ Failed: error 104 at offset 7: numbers out of order in {} quantifier /abc/\ -Failed: error 101 at offset 3: \ at end of pattern +Failed: error 101 at offset 4: \ at end of pattern /abc/\i -Failed: error 101 at offset 3: \ at end of pattern +Failed: error 101 at offset 4: \ at end of pattern /(a)bc(d)/I Capturing subpattern count = 2 @@ -1005,6 +1013,7 @@ Subject length lower bound = 16 Capturing subpattern count = 3 Compile options: <none> Overall options: anchored +Starting code units: a b Subject length lower bound = 4 adef\=get=1,get=2,get=3,get=4,getall 0: adef @@ -1043,6 +1052,7 @@ Get substring 4 failed (-49): unknown substring Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 7 abc\00def\=copy=0,getall 0: abc\x00def @@ -1228,6 +1238,7 @@ Subject length lower bound = 3 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'i' Subject length lower bound = 3 ississippi 0: iss @@ -1287,6 +1298,7 @@ Capturing subpattern count = 0 Contains explicit CR or LF match Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 3 ab\nab\ncd 0: ab\x0a @@ -1777,6 +1789,8 @@ Subject length lower bound = 2 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: 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 Subject length lower bound = 1 /^[[:^alnum:]]/IB @@ -1790,6 +1804,18 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \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 ! " # $ % & ' ( ) * + , - . / : ; < = > + ? @ [ \ ] ^ _ ` { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 + \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 + \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 + \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 + \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 + \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 + \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 + \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 + \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff Subject length lower bound = 1 /^[[:alpha:]]/IB @@ -1803,6 +1829,8 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: 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 Subject length lower bound = 1 /^[[:^alpha:]]/IB @@ -1816,6 +1844,19 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \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 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 + 5 6 7 8 9 : ; < = > ? @ [ \ ] ^ _ ` { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 + \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 + \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 + \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 + \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 + \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf + \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde + \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed + \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc + \xfd \xfe \xff Subject length lower bound = 1 /[_[:alpha:]]/I @@ -1835,6 +1876,12 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \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 ! " # $ % & ' ( ) * + , - . / 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 { | } ~ + \x7f Subject length lower bound = 1 /^[[:^ascii:]]/IB @@ -1848,6 +1895,15 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a + \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 + \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 + \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 + \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 + \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 + \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 + \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 + \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff Subject length lower bound = 1 /^[[:blank:]]/IB @@ -1861,6 +1917,7 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \x09 \x20 Subject length lower bound = 1 /^[[:^blank:]]/IB @@ -1874,6 +1931,20 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b + \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a + \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 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 { | } ~ \x7f \x80 + \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f + \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e + \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad + \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc + \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb + \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda + \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 + \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 + \xf9 \xfa \xfb \xfc \xfd \xfe \xff Subject length lower bound = 1 /[\n\x0b\x0c\x0d[:blank:]]/I @@ -1893,6 +1964,9 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \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 \x7f Subject length lower bound = 1 /^[[:digit:]]/IB @@ -1906,6 +1980,7 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: 0 1 2 3 4 5 6 7 8 9 Subject length lower bound = 1 /^[[:graph:]]/IB @@ -1919,6 +1994,9 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: ! " # $ % & ' ( ) * + , - . / 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 { | } ~ Subject length lower bound = 1 /^[[:lower:]]/IB @@ -1932,6 +2010,7 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: 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 Subject length lower bound = 1 /^[[:print:]]/IB @@ -1945,6 +2024,9 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 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 { | } ~ Subject length lower bound = 1 /^[[:punct:]]/IB @@ -1958,6 +2040,8 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ + _ ` { | } ~ Subject length lower bound = 1 /^[[:space:]]/IB @@ -1971,6 +2055,7 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 Subject length lower bound = 1 /^[[:upper:]]/IB @@ -1984,6 +2069,7 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: 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 Subject length lower bound = 1 /^[[:xdigit:]]/IB @@ -1997,6 +2083,7 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f Subject length lower bound = 1 /^[[:word:]]/IB @@ -2010,6 +2097,8 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: 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 Subject length lower bound = 1 /^[[:^cntrl:]]/IB @@ -2023,6 +2112,18 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 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 { | } ~ \x80 \x81 + \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 + \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f + \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae + \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd + \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc + \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb + \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea + \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 + \xfa \xfb \xfc \xfd \xfe \xff Subject length lower bound = 1 /^[12[:^digit:]]/IB @@ -2036,6 +2137,20 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \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 ! " # $ % & ' ( ) * + , - . / 1 2 : ; < + = > ? @ 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 { | } ~ \x7f \x80 \x81 \x82 + \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 + \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 + \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf + \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe + \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd + \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc + \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb + \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa + \xfb \xfc \xfd \xfe \xff Subject length lower bound = 1 /^[[:^blank:]]/IB @@ -2049,6 +2164,20 @@ Subject length lower bound = 1 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b + \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a + \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 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 { | } ~ \x7f \x80 + \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f + \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e + \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad + \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc + \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb + \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda + \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 + \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 + \xf9 \xfa \xfb \xfc \xfd \xfe \xff Subject length lower bound = 1 /[01[:alpha:]%]/IB @@ -2115,7 +2244,7 @@ No match Failed: error 108 at offset 9: range out of order in character class /^(?(0)f|b)oo/I -Failed: error 135 at offset 6: invalid condition (?(0) +Failed: error 115 at offset 5: reference to non-existent subpattern # This one's here because of the large output vector needed @@ -2123,7 +2252,7 @@ Failed: error 135 at offset 6: invalid condition (?(0) Capturing subpattern count = 271 Max back reference = 270 Starting code units: 0 1 2 3 4 5 6 7 8 9 -Subject length lower bound = 272 +Subject length lower bound = 0 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\=ovector=300 0: 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 1: 1 @@ -2419,6 +2548,7 @@ Subject length lower bound = 4 Capturing subpattern count = 2 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 1 aba 0: aba @@ -2429,6 +2559,7 @@ Subject length lower bound = 1 Capturing subpattern count = 2 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbaa 0: aabbaa @@ -2439,6 +2570,7 @@ Subject length lower bound = 2 Capturing subpattern count = 2 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbaa 0: aabbaa @@ -2449,6 +2581,7 @@ Subject length lower bound = 2 Capturing subpattern count = 2 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbaa 0: aabbaa @@ -2459,6 +2592,7 @@ Subject length lower bound = 2 Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbaa 0: aabbaa @@ -2468,6 +2602,7 @@ Subject length lower bound = 2 Capturing subpattern count = 3 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbaa 0: aabbaa @@ -2479,6 +2614,7 @@ Subject length lower bound = 2 Capturing subpattern count = 2 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbaa 0: aabbaa @@ -2489,6 +2625,7 @@ Subject length lower bound = 2 Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbaa 0: aabbaa @@ -2498,6 +2635,7 @@ Subject length lower bound = 2 Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbbaa 0: aabbbaa @@ -2507,6 +2645,7 @@ Subject length lower bound = 2 Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbbaa 0: aabbbaa @@ -2516,6 +2655,7 @@ Subject length lower bound = 2 Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbaa 0: aabbaa @@ -2525,6 +2665,7 @@ Subject length lower bound = 2 Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbbaa 0: aabbbaa @@ -2534,6 +2675,7 @@ Subject length lower bound = 2 Capturing subpattern count = 3 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbbaa 0: aabbbaa @@ -2545,6 +2687,7 @@ Subject length lower bound = 2 Capturing subpattern count = 3 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 aabbbbaa 0: aabbbbaa @@ -3053,6 +3196,7 @@ Subject length lower bound = 3 Capturing subpattern count = 5 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 3 /^x(?U)a+b/IB @@ -3068,6 +3212,7 @@ Subject length lower bound = 3 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'x' Last code unit = 'b' Subject length lower bound = 3 @@ -3086,6 +3231,7 @@ Subject length lower bound = 3 Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'x' Last code unit = 'b' Subject length lower bound = 3 @@ -3099,19 +3245,19 @@ Failed: error 113 at offset 0: POSIX collating elements are not supported Failed: error 112 at offset 0: POSIX named classes are supported only within a class /\l/I -Failed: error 137 at offset 1: PCRE does not support \L, \l, \N{name}, \U, or \u +Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u /\L/I -Failed: error 137 at offset 1: PCRE does not support \L, \l, \N{name}, \U, or \u +Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u /\N{name}/I -Failed: error 137 at offset 1: PCRE does not support \L, \l, \N{name}, \U, or \u +Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u /\u/I -Failed: error 137 at offset 1: PCRE does not support \L, \l, \N{name}, \U, or \u +Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u /\U/I -Failed: error 137 at offset 1: PCRE does not support \L, \l, \N{name}, \U, or \u +Failed: error 137 at offset 2: PCRE does not support \L, \l, \N{name}, \U, or \u /a{1,3}b/ungreedy ab @@ -3518,12 +3664,10 @@ Subject length lower bound = 6 1: abc 123abcdef\=callout_capture Callout 0: last capture = 1 - 0: <unset> 1: abc --->123abcdef ^ ^ d Callout 1: last capture = 1 - 0: <unset> 1: abc --->123abcdef ^ ^ f @@ -3545,25 +3689,25 @@ May match empty string Subject length lower bound = 0 abcabcabc --->abcabcabc - 0 ^ (abc(?C1))* - 1 ^ ^ ) - 1 ^ ^ ) - 1 ^ ^ ) + 0 ^ ( + 1 ^ ^ )* + 1 ^ ^ )* + 1 ^ ^ )* 0: abcabcabc 1: abc - abcabc\=callout_fail=1:3 + abcabc\=callout_fail=1:4 --->abcabc - 0 ^ (abc(?C1))* - 1 ^ ^ ) - 1 ^ ^ ) + 0 ^ ( + 1 ^ ^ )* + 1 ^ ^ )* 0: abcabc 1: abc - abcabcabc\=callout_fail=1:3 + abcabcabc\=callout_fail=1:4 --->abcabcabc - 0 ^ (abc(?C1))* - 1 ^ ^ ) - 1 ^ ^ ) - 1 ^ ^ ) + 0 ^ ( + 1 ^ ^ )* + 1 ^ ^ )* + 1 ^ ^ )* 0: abcabc 1: abc @@ -3573,38 +3717,32 @@ May match empty string Subject length lower bound = 0 123\=callout_capture Callout 0: last capture = 0 - 0: <unset> --->123 - ^ ^ ) + ^ ^ )* 0: 123 1: 123 123456\=callout_capture Callout 0: last capture = 0 - 0: <unset> --->123456 - ^ ^ ) + ^ ^ )* Callout 0: last capture = 1 - 0: <unset> 1: 123 --->123456 - ^ ^ ) + ^ ^ )* 0: 123456 1: 456 123456789\=callout_capture Callout 0: last capture = 0 - 0: <unset> --->123456789 - ^ ^ ) + ^ ^ )* Callout 0: last capture = 1 - 0: <unset> 1: 123 --->123456789 - ^ ^ ) + ^ ^ )* Callout 0: last capture = 1 - 0: <unset> 1: 456 --->123456789 - ^ ^ ) + ^ ^ )* 0: 123456789 1: 789 @@ -3614,13 +3752,11 @@ First code unit = 'x' Subject length lower bound = 4 xyzabc\=callout_capture Callout 0: last capture = 2 - 0: <unset> 1: <unset> 2: xyz --->xyzabc ^ ^ p Callout 1: last capture = 0 - 0: <unset> --->xyzabc ^ x 0: xyzabc @@ -3633,14 +3769,12 @@ Last code unit = 'x' Subject length lower bound = 5 Xxyzabc\=callout_capture Callout 0: last capture = 3 - 0: <unset> 1: X 2: <unset> 3: xyz --->Xxyzabc ^ ^ p Callout 1: last capture = 1 - 0: <unset> 1: X --->Xxyzabc ^^ x @@ -3655,7 +3789,6 @@ Last code unit = 'f' Subject length lower bound = 6 abcdef\=callout_capture Callout 0: last capture = 1 - 0: <unset> 1: abc --->abcdef ^ a @@ -3669,12 +3802,10 @@ Last code unit = 'z' Subject length lower bound = 6 abcxyz\=callout_capture Callout 1: last capture = 1 - 0: <unset> 1: abc --->abcxyz ^ ^ d Callout 2: last capture = 0 - 0: <unset> --->abcxyz ^ a 0: abcxyz @@ -3687,7 +3818,6 @@ Last code unit = 'z' Subject length lower bound = 3 abcxyz\=callout_capture Callout 0: last capture = 1 - 0: <unset> 1: abc --->abcxyz ^ ) @@ -3702,7 +3832,7 @@ Subject length lower bound = 2 \= Expect no match abbbbbccc\=callout_data=1 --->abbbbbccc - 1 ^ ^ + 1 ^ ^ End of pattern Callout data = 1 No match @@ -3714,21 +3844,21 @@ Subject length lower bound = 2 \= Expect no match abbbbbccc\=callout_data=1 --->abbbbbccc - 1 ^ ^ + 1 ^ ^ End of pattern Callout data = 1 - 1 ^ ^ + 1 ^ ^ End of pattern Callout data = 1 - 1 ^ ^ + 1 ^ ^ End of pattern Callout data = 1 - 1 ^ ^ + 1 ^ ^ End of pattern Callout data = 1 - 1 ^ ^ + 1 ^ ^ End of pattern Callout data = 1 - 1 ^ ^ + 1 ^ ^ End of pattern Callout data = 1 - 1 ^ ^ + 1 ^ ^ End of pattern Callout data = 1 - 1 ^ ^ + 1 ^ ^ End of pattern Callout data = 1 No match @@ -3742,6 +3872,7 @@ Subject length lower bound = 3 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 3 /(?C)a|b/I @@ -3749,6 +3880,16 @@ Capturing subpattern count = 0 Starting code units: a b Subject length lower bound = 1 +/a|(b)(?C)/I +Capturing subpattern count = 1 +Starting code units: a b +Subject length lower bound = 1 + b +--->b + 0 ^^ End of pattern + 0: b + 1: b + /x(ab|(bc|(de|(?R))))/I Capturing subpattern count = 3 First code unit = 'x' @@ -3802,6 +3943,7 @@ No match Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = '>' Last code unit = '<' Subject length lower bound = 10 >abc>123<xyz< @@ -3835,7 +3977,7 @@ Subject length lower bound = 2 Bra CBra 1 a - Once + SBra Recurse KetRmax b @@ -3852,6 +3994,7 @@ Subject length lower bound = 2 Capturing subpattern count = 2 Compile options: <none> Overall options: anchored +Starting code units: ( - 0 1 2 3 4 5 6 7 8 9 Subject length lower bound = 1 12 0: 12 @@ -3871,6 +4014,7 @@ No match Capturing subpattern count = 2 Compile options: <none> Overall options: anchored +First code unit = 'x' Subject length lower bound = 3 xyz 0: xyz @@ -3930,6 +4074,7 @@ Failed: error 114 at offset 10: missing closing parenthesis Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 9 abcdefabc 0: abcdefabc @@ -3939,7 +4084,8 @@ Subject length lower bound = 9 Capturing subpattern count = 1 Compile options: <none> Overall options: anchored -Subject length lower bound = 3 +Starting code units: a b c +Subject length lower bound = 2 a=a 0: a=a 1: a @@ -3954,6 +4100,7 @@ Subject length lower bound = 3 Capturing subpattern count = 2 Compile options: <none> Overall options: anchored +Starting code units: a b c Subject length lower bound = 2 a=a 0: a=a @@ -4263,7 +4410,7 @@ Subject length lower bound = 2 Callout data = 1 0: ab 1: ab -\= Expect no match +\= Expect no match aaabbb\=callout_data=-1 --->aaabbb 1 ^ ^ b @@ -4355,10 +4502,10 @@ Subject length lower bound = 4 C aa (2) A (group 2) /(?P<x>eks)(?P<x>eccs)/I -Failed: error 143 at offset 15: two named subpatterns have the same name (PCRE2_DUPNAMES not set) +Failed: error 143 at offset 16: two named subpatterns have the same name (PCRE2_DUPNAMES not set) /(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I -Failed: error 143 at offset 30: two named subpatterns have the same name (PCRE2_DUPNAMES not set) +Failed: error 143 at offset 31: two named subpatterns have the same name (PCRE2_DUPNAMES not set) "\[((?P<elem>\d+)(,(?P>elem))*)\]"I Capturing subpattern count = 3 @@ -4581,7 +4728,7 @@ Subject length lower bound = 5 +2 ^ ^ c +3 ^ ^ d +4 ^ ^ e - +5 ^ ^ + +5 ^ ^ End of pattern 0: abcde \= Expect no match abcdfe @@ -4613,13 +4760,13 @@ Subject length lower bound = 1 --->ab +0 ^ a* +2 ^^ b - +3 ^ ^ + +3 ^ ^ End of pattern 0: ab aaaab --->aaaab +0 ^ a* +2 ^ ^ b - +3 ^ ^ + +3 ^ ^ End of pattern 0: aaaab aaaacb --->aaaacb @@ -4633,7 +4780,7 @@ Subject length lower bound = 1 +2 ^^ b +0 ^ a* +2 ^ b - +3 ^^ + +3 ^^ End of pattern 0: b /a*b/IB,auto_callout @@ -4656,13 +4803,13 @@ Subject length lower bound = 1 --->ab +0 ^ a* +2 ^^ b - +3 ^ ^ + +3 ^ ^ End of pattern 0: ab aaaab --->aaaab +0 ^ a* +2 ^ ^ b - +3 ^ ^ + +3 ^ ^ End of pattern 0: aaaab aaaacb --->aaaacb @@ -4676,7 +4823,7 @@ Subject length lower bound = 1 +2 ^^ b +0 ^ a* +2 ^ b - +3 ^^ + +3 ^^ End of pattern 0: b /a+b/IB,auto_callout @@ -4699,15 +4846,15 @@ Subject length lower bound = 2 --->ab +0 ^ a+ +2 ^^ b - +3 ^ ^ + +3 ^ ^ End of pattern 0: ab aaaab --->aaaab +0 ^ a+ +2 ^ ^ b - +3 ^ ^ + +3 ^ ^ End of pattern 0: aaaab -\= Expect no match +\= Expect no match aaaacb --->aaaacb +0 ^ a+ @@ -4723,7 +4870,7 @@ No match /(abc|def)x/IB,auto_callout ------------------------------------------------------------------ Bra - Callout 255 0 9 + Callout 255 0 1 CBra 1 Callout 255 1 1 a @@ -4731,7 +4878,7 @@ No match b Callout 255 3 1 c - Callout 255 4 0 + Callout 255 4 1 Alt Callout 255 5 1 d @@ -4739,7 +4886,7 @@ No match e Callout 255 7 1 f - Callout 255 8 0 + Callout 255 8 1 Ket Callout 255 9 1 x @@ -4754,38 +4901,38 @@ Last code unit = 'x' Subject length lower bound = 4 abcx --->abcx - +0 ^ (abc|def) + +0 ^ ( +1 ^ a +2 ^^ b +3 ^ ^ c +4 ^ ^ | +9 ^ ^ x -+10 ^ ^ ++10 ^ ^ End of pattern 0: abcx 1: abc defx --->defx - +0 ^ (abc|def) + +0 ^ ( +1 ^ a +5 ^ d +6 ^^ e +7 ^ ^ f +8 ^ ^ ) +9 ^ ^ x -+10 ^ ^ ++10 ^ ^ End of pattern 0: defx 1: def -\= Expect no match +\= Expect no match abcdefzx --->abcdefzx - +0 ^ (abc|def) + +0 ^ ( +1 ^ a +2 ^^ b +3 ^ ^ c +4 ^ ^ | +9 ^ ^ x +5 ^ d - +0 ^ (abc|def) + +0 ^ ( +1 ^ a +5 ^ d +6 ^^ e @@ -4797,7 +4944,7 @@ No match /(abc|def)x/IB,auto_callout ------------------------------------------------------------------ Bra - Callout 255 0 9 + Callout 255 0 1 CBra 1 Callout 255 1 1 a @@ -4805,7 +4952,7 @@ No match b Callout 255 3 1 c - Callout 255 4 0 + Callout 255 4 1 Alt Callout 255 5 1 d @@ -4813,7 +4960,7 @@ No match e Callout 255 7 1 f - Callout 255 8 0 + Callout 255 8 1 Ket Callout 255 9 1 x @@ -4828,38 +4975,38 @@ Last code unit = 'x' Subject length lower bound = 4 abcx --->abcx - +0 ^ (abc|def) + +0 ^ ( +1 ^ a +2 ^^ b +3 ^ ^ c +4 ^ ^ | +9 ^ ^ x -+10 ^ ^ ++10 ^ ^ End of pattern 0: abcx 1: abc defx --->defx - +0 ^ (abc|def) + +0 ^ ( +1 ^ a +5 ^ d +6 ^^ e +7 ^ ^ f +8 ^ ^ ) +9 ^ ^ x -+10 ^ ^ ++10 ^ ^ End of pattern 0: defx 1: def -\= Expect no match +\= Expect no match abcdefzx --->abcdefzx - +0 ^ (abc|def) + +0 ^ ( +1 ^ a +2 ^^ b +3 ^ ^ c +4 ^ ^ | +9 ^ ^ x +5 ^ d - +0 ^ (abc|def) + +0 ^ ( +1 ^ a +5 ^ d +6 ^^ e @@ -4875,7 +5022,7 @@ Starting code units: a c Subject length lower bound = 6 ababab --->ababab - +0 ^ (ab|cd){3,4} + +0 ^ ( +1 ^ a +2 ^^ b +3 ^ ^ | @@ -4887,55 +5034,55 @@ Subject length lower bound = 6 +3 ^ ^ | +1 ^ ^ a +4 ^ ^ c -+12 ^ ^ ++12 ^ ^ End of pattern 0: ababab 1: ab abcdabcd --->abcdabcd - +0 ^ (ab|cd){3,4} + +0 ^ ( +1 ^ a +2 ^^ b +3 ^ ^ | +1 ^ ^ a +4 ^ ^ c +5 ^ ^ d - +6 ^ ^ ) + +6 ^ ^ ){3,4} +1 ^ ^ a +2 ^ ^ b +3 ^ ^ | +1 ^ ^ a +4 ^ ^ c +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ + +6 ^ ^ ){3,4} ++12 ^ ^ End of pattern 0: abcdabcd 1: cd abcdcdcdcdcd --->abcdcdcdcdcd - +0 ^ (ab|cd){3,4} + +0 ^ ( +1 ^ a +2 ^^ b +3 ^ ^ | +1 ^ ^ a +4 ^ ^ c +5 ^ ^ d - +6 ^ ^ ) + +6 ^ ^ ){3,4} +1 ^ ^ a +4 ^ ^ c +5 ^ ^ d - +6 ^ ^ ) + +6 ^ ^ ){3,4} +1 ^ ^ a +4 ^ ^ c +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ + +6 ^ ^ ){3,4} ++12 ^ ^ End of pattern 0: abcdcdcd 1: cd /([ab]{,4}c|xy)/IB,auto_callout ------------------------------------------------------------------ Bra - Callout 255 0 14 + Callout 255 0 1 CBra 1 Callout 255 1 4 [ab] @@ -4949,13 +5096,13 @@ Subject length lower bound = 6 } Callout 255 9 1 c - Callout 255 10 0 + Callout 255 10 1 Alt Callout 255 11 1 x Callout 255 12 1 y - Callout 255 13 0 + Callout 255 13 1 Ket Callout 255 14 0 Ket @@ -4965,18 +5112,18 @@ Capturing subpattern count = 1 Options: auto_callout Starting code units: a b x Subject length lower bound = 2 -\= Expect no match +\= Expect no match Note: that { does NOT introduce a quantifier --->Note: that { does NOT introduce a quantifier - +0 ^ ([ab]{,4}c|xy) + +0 ^ ( +1 ^ [ab] +5 ^^ { +11 ^ x - +0 ^ ([ab]{,4}c|xy) + +0 ^ ( +1 ^ [ab] +5 ^^ { +11 ^ x - +0 ^ ([ab]{,4}c|xy) + +0 ^ ( +1 ^ [ab] +5 ^^ { +11 ^ x @@ -4985,7 +5132,7 @@ No match /([ab]{,4}c|xy)/IB,auto_callout ------------------------------------------------------------------ Bra - Callout 255 0 14 + Callout 255 0 1 CBra 1 Callout 255 1 4 [ab] @@ -4999,13 +5146,13 @@ No match } Callout 255 9 1 c - Callout 255 10 0 + Callout 255 10 1 Alt Callout 255 11 1 x Callout 255 12 1 y - Callout 255 13 0 + Callout 255 13 1 Ket Callout 255 14 0 Ket @@ -5015,18 +5162,18 @@ Capturing subpattern count = 1 Options: auto_callout Starting code units: a b x Subject length lower bound = 2 -\= Expect no match +\= Expect no match Note: that { does NOT introduce a quantifier --->Note: that { does NOT introduce a quantifier - +0 ^ ([ab]{,4}c|xy) + +0 ^ ( +1 ^ [ab] +5 ^^ { +11 ^ x - +0 ^ ([ab]{,4}c|xy) + +0 ^ ( +1 ^ [ab] +5 ^^ { +11 ^ x - +0 ^ ([ab]{,4}c|xy) + +0 ^ ( +1 ^ [ab] +5 ^^ { +11 ^ x @@ -5035,58 +5182,58 @@ No match /([ab]{1,4}c|xy){4,5}?123/IB,auto_callout ------------------------------------------------------------------ Bra - Callout 255 0 21 + Callout 255 0 1 CBra 1 Callout 255 1 9 [ab]{1,4}+ Callout 255 10 1 c - Callout 255 11 0 + Callout 255 11 1 Alt Callout 255 12 1 x Callout 255 13 1 y - Callout 255 14 0 + Callout 255 14 7 Ket CBra 1 Callout 255 1 9 [ab]{1,4}+ Callout 255 10 1 c - Callout 255 11 0 + Callout 255 11 1 Alt Callout 255 12 1 x Callout 255 13 1 y - Callout 255 14 0 + Callout 255 14 7 Ket CBra 1 Callout 255 1 9 [ab]{1,4}+ Callout 255 10 1 c - Callout 255 11 0 + Callout 255 11 1 Alt Callout 255 12 1 x Callout 255 13 1 y - Callout 255 14 0 + Callout 255 14 7 Ket CBra 1 Callout 255 1 9 [ab]{1,4}+ Callout 255 10 1 c - Callout 255 11 0 + Callout 255 11 1 Alt Callout 255 12 1 x Callout 255 13 1 y - Callout 255 14 0 + Callout 255 14 7 Ket Braminzero CBra 1 @@ -5094,13 +5241,13 @@ No match [ab]{1,4}+ Callout 255 10 1 c - Callout 255 11 0 + Callout 255 11 1 Alt Callout 255 12 1 x Callout 255 13 1 y - Callout 255 14 0 + Callout 255 14 7 Ket Callout 255 21 1 1 @@ -5119,7 +5266,7 @@ Last code unit = '3' Subject length lower bound = 11 aacaacaacaacaac123 --->aacaacaacaacaac123 - +0 ^ ([ab]{1,4}c|xy){4,5}? + +0 ^ ( +1 ^ [ab]{1,4} +10 ^ ^ c +11 ^ ^ | @@ -5139,7 +5286,7 @@ Subject length lower bound = 11 +21 ^ ^ 1 +22 ^ ^ 2 +23 ^ ^ 3 -+24 ^ ^ ++24 ^ ^ End of pattern 0: aacaacaacaacaac123 1: aac @@ -5190,6 +5337,7 @@ No match Capturing subpattern count = 3 Compile options: <none> Overall options: anchored +Starting code units: 0 1 2 3 4 5 6 7 8 9 Last code unit = '/' Subject length lower bound = 6 13/05/04\=ps @@ -5287,6 +5435,7 @@ Partial match: c12 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: 0 1 2 3 4 5 6 7 8 9 Last code unit = 'X' Subject length lower bound = 4 1\=ps @@ -5651,7 +5800,7 @@ First code unit = \xff Subject length lower bound = 1 /^((?P<A>a1)|(?P<A>a2)b)/I -Failed: error 143 at offset 17: two named subpatterns have the same name (PCRE2_DUPNAMES not set) +Failed: error 143 at offset 18: two named subpatterns have the same name (PCRE2_DUPNAMES not set) /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames Capturing subpattern count = 3 @@ -5660,6 +5809,7 @@ Named capturing subpatterns: A 3 Compile options: dupnames Overall options: anchored dupnames +First code unit = 'a' Subject length lower bound = 2 a1b\=copy=A 0: a1 @@ -5679,7 +5829,7 @@ Subject length lower bound = 2 Number not found for group 'Z' Copy substring 'Z' failed (-49): unknown substring C a1 (2) A (non-unique) - + /(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/I,dupnames Capturing subpattern count = 3 Named capturing subpatterns: @@ -5697,6 +5847,7 @@ Named capturing subpatterns: A 2 Compile options: dupnames Overall options: anchored dupnames +First code unit = 'a' Subject length lower bound = 2 ab\=copy=A 0: ab @@ -5710,6 +5861,7 @@ Named capturing subpatterns: A 1 A 2 Options: dupnames +Starting code units: a c Subject length lower bound = 2 ab\=copy=A 0: ab @@ -5728,6 +5880,7 @@ Named capturing subpatterns: A 3 A 4 Options: dupnames +Starting code units: a c Subject length lower bound = 2 cdefgh\=copy=A 0: cdefgh @@ -5744,6 +5897,7 @@ Named capturing subpatterns: A 3 Compile options: dupnames Overall options: anchored dupnames +First code unit = 'a' Subject length lower bound = 2 a1b\=get=A 0: a1 @@ -5771,6 +5925,7 @@ Named capturing subpatterns: A 2 Compile options: dupnames Overall options: anchored dupnames +First code unit = 'a' Subject length lower bound = 2 ab\=get=A 0: ab @@ -5784,6 +5939,7 @@ Named capturing subpatterns: A 1 A 2 Options: dupnames +Starting code units: a c Subject length lower bound = 2 ab\=get=A 0: ab @@ -5802,6 +5958,7 @@ Named capturing subpatterns: A 3 A 4 Options: dupnames +Starting code units: a c Subject length lower bound = 2 cdefgh\=get=A 0: cdefgh @@ -5819,6 +5976,7 @@ Named capturing subpatterns: Compile options: <none> Overall options: anchored Duplicate name status changes +First code unit = 'a' Subject length lower bound = 2 a1b\=copy=A 0: a1 @@ -5833,7 +5991,7 @@ Subject length lower bound = 2 C a2 (2) A (non-unique) /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I -Failed: error 143 at offset 37: two named subpatterns have the same name (PCRE2_DUPNAMES not set) +Failed: error 143 at offset 38: two named subpatterns have the same name (PCRE2_DUPNAMES not set) # In this next test, J is not set at the outer level; consequently it isn't set # in the pattern's options; consequently pcre2_substring_get_byname() produces @@ -5849,6 +6007,7 @@ Named capturing subpatterns: Compile options: <none> Overall options: anchored Duplicate name status changes +First code unit = 'a' Subject length lower bound = 6 a bc d\=copy=A,copy=B,copy=C 0: a bc d @@ -5889,10 +6048,10 @@ Subject length lower bound = 2 1: X /(?:(?(2y)a|b)(X))+/I -Failed: error 126 at offset 7: malformed number or name after (?( +Failed: error 124 at offset 7: missing closing parenthesis for condition /(?:(?(ZA)a|b)(?P<ZZ>X))+/I -Failed: error 115 at offset 9: reference to non-existent subpattern +Failed: error 115 at offset 6: reference to non-existent subpattern /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I Capturing subpattern count = 1 @@ -5998,7 +6157,7 @@ Subject length lower bound = 3 No match xyz\rabclf No match - + /^abc/Im,newline=cr Capturing subpattern count = 0 Options: multiline @@ -6250,6 +6409,7 @@ Subject length lower bound = 4 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: a b Last code unit = 'b' Subject length lower bound = 2 @@ -6266,6 +6426,7 @@ Subject length lower bound = 2 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: a b Last code unit = 'b' Subject length lower bound = 2 @@ -6282,6 +6443,7 @@ Subject length lower bound = 2 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +Starting code units: a b Last code unit = 'b' Subject length lower bound = 2 @@ -6298,6 +6460,7 @@ Subject length lower bound = 2 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'a' Last code unit = 'A' Subject length lower bound = 3 aaaA5 @@ -6319,6 +6482,7 @@ No match Capturing subpattern count = 0 Compile options: caseless Overall options: anchored caseless +Starting code units: A a Last code unit = 'A' (caseless) Subject length lower bound = 2 aaaA5 @@ -7023,7 +7187,7 @@ No match No match /^(?P>abc)(?<abcd>xxx)/ -Failed: error 115 at offset 8: reference to non-existent subpattern +Failed: error 115 at offset 5: reference to non-existent subpattern /^(?P>abc)(?<abc>x|y)/ xx @@ -7283,13 +7447,13 @@ No match No match /(?(<bc))/ -Failed: error 126 at offset 6: malformed number or name after (?( +Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator) /(?(''))/ -Failed: error 128 at offset 4: assertion expected after (?( or (?(?C) +Failed: error 162 at offset 4: subpattern name expected /(?('R')stuff)/ -Failed: error 115 at offset 7: reference to non-existent subpattern +Failed: error 115 at offset 4: reference to non-existent subpattern /((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x abcabc1Xabc2XabcXabcabc @@ -7304,10 +7468,10 @@ Failed: error 115 at offset 7: reference to non-existent subpattern 2: abcabc1Xabc2XabcX /(?<A> (?'B' abc (?(R) (?(R&C)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x -Failed: error 115 at offset 29: reference to non-existent subpattern +Failed: error 115 at offset 27: reference to non-existent subpattern /^(?(DEFINE) abc | xyz ) /x -Failed: error 154 at offset 22: DEFINE group contains more than one branch +Failed: error 154 at offset 4: DEFINE group contains more than one branch /(?(DEFINE) abc) xyz/Ix Capturing subpattern count = 0 @@ -7513,19 +7677,19 @@ No match No match /^(a)\g-2/ -Failed: error 115 at offset 7: reference to non-existent subpattern +Failed: error 115 at offset 8: reference to non-existent subpattern /^(a)\g/ -Failed: error 158 at offset 5: a numbered reference must not be zero +Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number /^(a)\g{0}/ -Failed: error 158 at offset 8: a numbered reference must not be zero +Failed: error 115 at offset 9: reference to non-existent subpattern /^(a)\g{3/ -Failed: error 157 at offset 8: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number +Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number /^(a)\g{aa}/ -Failed: error 115 at offset 9: reference to non-existent subpattern +Failed: error 115 at offset 7: reference to non-existent subpattern /^a.b/newline=lf a\rb @@ -7568,13 +7732,13 @@ No match 0: \x0d\x0afoo \nfoo 0: \x0afoo - + /^$/gm,newline=any abc\r\rxyz 0: - abc\n\rxyz + abc\n\rxyz 0: -\= Expect no match +\= Expect no match abc\r\nxyz No match @@ -7589,7 +7753,7 @@ No match 0+ \x0d\x0a 0: \x0d\x0a 0+ - + /(?m)$/g,newline=any,aftertext abc\r\n\r\n 0: @@ -7609,7 +7773,7 @@ No match /^X/m XABC 0: X -\= Expect no match +\= Expect no match XABC\=notbol No match @@ -7644,17 +7808,17 @@ No match 0: xyabcabc 1: abc \= Expect no match - xyabc + xyabc No match - + /x(?-0)y/ -Failed: error 158 at offset 5: a numbered reference must not be zero +Failed: error 126 at offset 5: a relative value of zero is not allowed /x(?-1)y/ Failed: error 115 at offset 5: reference to non-existent subpattern /x(?+0)y/ -Failed: error 158 at offset 5: a numbered reference must not be zero +Failed: error 126 at offset 5: a relative value of zero is not allowed /x(?+1)y/ Failed: error 115 at offset 5: reference to non-existent subpattern @@ -7682,9 +7846,9 @@ Failed: error 115 at offset 5: reference to non-existent subpattern Y 0: Y \= Expect no match - abcY + abcY No match - + /^((?(+1)X|Y)(abc))+/B ------------------------------------------------------------------ Bra @@ -7712,11 +7876,11 @@ No match 1: Xabc 2: abc \= Expect no match - XabcXabc + XabcXabc No match /(?(-1)a)/B -Failed: error 115 at offset 6: reference to non-existent subpattern +Failed: error 115 at offset 5: reference to non-existent subpattern /((?(-1)a))/B ------------------------------------------------------------------ @@ -7732,7 +7896,7 @@ Failed: error 115 at offset 6: reference to non-existent subpattern ------------------------------------------------------------------ /((?(-2)a))/B -Failed: error 115 at offset 7: reference to non-existent subpattern +Failed: error 115 at offset 6: reference to non-existent subpattern /^(?(+1)X|Y)(.)/B ------------------------------------------------------------------ @@ -7758,11 +7922,11 @@ Failed: error 115 at offset 7: reference to non-existent subpattern tom-tom 0: tom-tom 1: tom - bon-bon + bon-bon 0: bon-bon 1: bon \= Expect no match - tom-bon + tom-bon No match /\g{A/ @@ -7786,7 +7950,7 @@ Failed: error 142 at offset 4: syntax error in subpattern name (missing terminat >abc< 0: abc 1: abc - >xyz< + >xyz< 0: xyz 1: xyz @@ -7816,7 +7980,7 @@ Failed: error 142 at offset 4: syntax error in subpattern name (missing terminat 1: x 2: abc 3: x - xxyzx + xxyzx 0: xxyzx 1: x 2: xyz @@ -7852,7 +8016,7 @@ Failed: error 142 at offset 4: syntax error in subpattern name (missing terminat 2: abc 3: pqr 4: x - xxyzx + xxyzx 0: xxyzx 1: x 2: xyz @@ -7870,7 +8034,7 @@ Failed: error 142 at offset 4: syntax error in subpattern name (missing terminat \= Expect no match XXXX No match - + /\H+\hY/B ------------------------------------------------------------------ Bra @@ -7880,7 +8044,7 @@ No match Ket End ------------------------------------------------------------------ - XXXX Y + XXXX Y 0: XXXX Y /\H+ Y/B @@ -8107,7 +8271,7 @@ Failed: error 106 at offset 10: missing terminating ] for character class +3 ^ ^ (*FAIL) +3 ^^ (*FAIL) No match - + /a+b?c+(*FAIL)/auto_callout \= Expect no match aaabccc @@ -8171,7 +8335,7 @@ No match +15 ^ ^ (*FAIL) +15 ^ ^ (*FAIL) No match - + /a+b?(*SKIP)c+(*FAIL)/auto_callout \= Expect no match aaabcccaaabccc @@ -8218,15 +8382,15 @@ No match +13 ^ ^ (*FAIL) +13 ^ ^ (*FAIL) No match - + /a(*MARK)b/ Failed: error 166 at offset 7: (*MARK) must have an argument /(?i:A{1,}\6666666666)/ -Failed: error 161 at offset 19: number is too big +Failed: error 161 at offset 19: group number is too big /\g6666666666/ -Failed: error 161 at offset 11: number is too big +Failed: error 161 at offset 7: group number is too big /[\g6666666666]/B ------------------------------------------------------------------ @@ -8243,17 +8407,17 @@ Failed: error 115 at offset 3: reference to non-existent subpattern \= Expect no match \r\nA No match - + /\nA/newline=crlf - \r\nA + \r\nA 0: \x0aA /[\r\n]A/newline=crlf - \r\nA + \r\nA 0: \x0aA /(\r|\n)A/newline=crlf - \r\nA + \r\nA 0: \x0aA 1: \x0a @@ -8264,52 +8428,52 @@ Failed: error 160 at offset 5: (*VERB) not recognized or malformed a\nb 0: a\x0ab \= Expect no match - a\rb + a\rb No match /(*CR)a.b/newline=lf a\nb 0: a\x0ab \= Expect no match - a\rb + a\rb No match /(*LF)a.b/newline=CRLF a\rb 0: a\x0db \= Expect no match - a\nb + a\nb No match /(*CRLF)a.b/ a\rb 0: a\x0db - a\nb + a\nb 0: a\x0ab \= Expect no match - a\r\nb + a\r\nb No match /(*ANYCRLF)a.b/newline=CR \= Expect no match a\rb No match - a\nb + a\nb No match - a\r\nb + a\r\nb No match /(*ANY)a.b/newline=cr \= Expect no match a\rb No match - a\nb + a\nb No match - a\r\nb + a\r\nb No match - a\x85b + a\x85b No match - + /(*ANY).*/g abc\r\ndef 0: abc @@ -8331,6 +8495,31 @@ No match 0: def 0: +/(*NUL)^.*/ + a\nb\x00ccc + 0: a\x0ab + +/(*NUL)^.*/s + a\nb\x00ccc + 0: a\x0ab\x00ccc + +/^x/m,newline=NUL + ab\x00xy + 0: x + +/'#comment' 0d 0a 00 '^x\' 0a 'y'/x,newline=nul,hex + x\nyz + 0: x\x0ay + +/(*NUL)^X\NY/ + X\nY + 0: X\x0aY + X\rY + 0: X\x0dY +\= Expect no match + X\x00Y +No match + /a\Rb/I,bsr=anycrlf Capturing subpattern count = 0 \R matches CR, LF, or CRLF @@ -8346,7 +8535,7 @@ Subject length lower bound = 3 \= Expect no match a\x85b No match - a\x0bb + a\x0bb No match /a\Rb/I,bsr=unicode @@ -8363,9 +8552,9 @@ Subject length lower bound = 3 0: a\x0d\x0ab a\x85b 0: a\x85b - a\x0bb + a\x0bb 0: a\x0bb - + /a\R?b/I,bsr=anycrlf Capturing subpattern count = 0 \R matches CR, LF, or CRLF @@ -8381,7 +8570,7 @@ Subject length lower bound = 2 \= Expect no match a\x85b No match - a\x0bb + a\x0bb No match /a\R?b/I,bsr=unicode @@ -8398,9 +8587,9 @@ Subject length lower bound = 2 0: a\x0d\x0ab a\x85b 0: a\x85b - a\x0bb + a\x0bb 0: a\x0bb - + /a\R{2,4}b/I,bsr=anycrlf Capturing subpattern count = 0 \R matches CR, LF, or CRLF @@ -8416,7 +8605,7 @@ Subject length lower bound = 4 \= Expect no match a\x85\x85b No match - a\x0b\x0bb + a\x0b\x0bb No match /a\R{2,4}b/I,bsr=unicode @@ -8433,12 +8622,12 @@ Subject length lower bound = 4 0: a\x0d\x0a\x0a\x0d\x0db a\x85\x85b 0: a\x85\x85b - a\x0b\x0bb + a\x0b\x0bb 0: a\x0b\x0bb -\= Expect no match - a\r\r\r\r\rb +\= Expect no match + a\r\r\r\r\rb No match - + /(*BSR_ANYCRLF)a\Rb/I Capturing subpattern count = 0 \R matches CR, LF, or CRLF @@ -8447,7 +8636,7 @@ Last code unit = 'b' Subject length lower bound = 3 a\nb 0: a\x0ab - a\rb + a\rb 0: a\x0db /(*BSR_UNICODE)a\Rb/I @@ -8468,7 +8657,7 @@ Last code unit = 'b' Subject length lower bound = 3 a\nb 0: a\x0ab - a\rb + a\rb 0: a\x0db /(*CRLF)(*BSR_UNICODE)a\Rb/I @@ -8493,25 +8682,25 @@ Subject length lower bound = 2 Failed: error 162 at offset 9: subpattern name expected /(?<abc>)(?&a)/ -Failed: error 115 at offset 12: reference to non-existent subpattern +Failed: error 115 at offset 11: reference to non-existent subpattern /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/ -Failed: error 115 at offset 32: reference to non-existent subpattern +Failed: error 115 at offset 9: reference to non-existent subpattern /(?+-a)/ -Failed: error 163 at offset 3: digit expected after (?+ +Failed: error 129 at offset 2: digit expected after (?+ or (?- /(?-+a)/ Failed: error 111 at offset 3: unrecognized character after (? or (?- /(?(-1))/ -Failed: error 115 at offset 6: reference to non-existent subpattern +Failed: error 115 at offset 5: reference to non-existent subpattern /(?(+10))/ -Failed: error 115 at offset 7: reference to non-existent subpattern +Failed: error 115 at offset 4: reference to non-existent subpattern /(?(10))/ -Failed: error 115 at offset 6: reference to non-existent subpattern +Failed: error 115 at offset 3: reference to non-existent subpattern /(?(+2))()()/ @@ -8527,10 +8716,10 @@ Failed: error 162 at offset 3: subpattern name expected Failed: error 162 at offset 3: subpattern name expected /\k/ -Failed: error 169 at offset 1: \k is not followed by a braced, angle-bracketed, or quoted name +Failed: error 169 at offset 2: \k is not followed by a braced, angle-bracketed, or quoted name /\kabc/ -Failed: error 169 at offset 1: \k is not followed by a braced, angle-bracketed, or quoted name +Failed: error 169 at offset 2: \k is not followed by a braced, angle-bracketed, or quoted name /(?P=)/ Failed: error 162 at offset 4: subpattern name expected @@ -8571,10 +8760,10 @@ Failed: error 157 at offset 8: \g is not followed by a braced, angle-bracketed, /^(?+1)(?<a>x|y){0}z/ xzxx 0: xz - yzyy + yzyy 0: yz \= Expect no match - xxz + xxz No match /(\3)(\1)(a)/ @@ -8588,13 +8777,13 @@ No match 1: 2: 3: a - + /TA]/ - The ACTA] comes + The ACTA] comes 0: TA] /TA]/alt_bsux,allow_empty_class,match_unset_backref,dupnames - The ACTA] comes + The ACTA] comes 0: TA] /(?2)[]a()b](abc)/ @@ -8609,7 +8798,7 @@ Failed: error 115 at offset 3: reference to non-existent subpattern abcbabc 0: abcbabc 1: abc -\= Expect no match +\= Expect no match abcXabc No match @@ -8617,7 +8806,7 @@ No match abcXabc 0: abcXabc 1: abc -\= Expect no match +\= Expect no match abcbabc No match @@ -8628,11 +8817,11 @@ No match 2: xyz /(?&N)[]a(?<N>)](?<M>abc)/ -Failed: error 115 at offset 4: reference to non-existent subpattern +Failed: error 115 at offset 3: reference to non-existent subpattern abc<abc /(?&N)[]a(?<N>)](abc)/ -Failed: error 115 at offset 4: reference to non-existent subpattern +Failed: error 115 at offset 3: reference to non-existent subpattern abc<abc /a[]b/ @@ -8648,30 +8837,30 @@ No match /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames \= Expect no match - ab + ab No match /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames \= Expect no match - ab + ab No match /a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames aXb 0: aXb - a\nb + a\nb 0: a\x0ab \= Expect no match - ab + ab No match - + /a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames aXb 0: aXb - a\nX\nXb + a\nX\nXb 0: a\x0aX\x0aXb \= Expect no match - ab + ab No match /a(?!)b/B @@ -8712,8 +8901,8 @@ Options: auto_callout Subject length lower bound = 0 adc --->adc - +0 ^ (?(?=.*b)b|^) - +2 ^ (?=.*b) + +0 ^ (? + +2 ^ (?= +5 ^ .* +7 ^ ^ b +7 ^ ^ b @@ -8721,20 +8910,20 @@ Subject length lower bound = 0 +7 ^ b +11 ^ ^ +12 ^ ) -+13 ^ ++13 ^ End of pattern 0: - abc + abc --->abc - +0 ^ (?(?=.*b)b|^) - +2 ^ (?=.*b) + +0 ^ (? + +2 ^ (?= +5 ^ .* +7 ^ ^ b +7 ^ ^ b +7 ^^ b +8 ^ ^ ) +9 ^ b - +0 ^ (?(?=.*b)b|^) - +2 ^ (?=.*b) + +0 ^ (? + +2 ^ (?= +5 ^ .* +7 ^ ^ b +7 ^^ b @@ -8742,41 +8931,40 @@ Subject length lower bound = 0 +8 ^^ ) +9 ^ b +10 ^^ | -+13 ^^ ++13 ^^ End of pattern 0: b - + /(?(?=b).*b|^d)/I Capturing subpattern count = 0 Subject length lower bound = 1 /(?(?=.*b).*b|^d)/I Capturing subpattern count = 0 -First code unit at start or follows newline Subject length lower bound = 1 /xyz/auto_callout - xyz + xyz --->xyz +0 ^ x +1 ^^ y +2 ^ ^ z - +3 ^ ^ + +3 ^ ^ End of pattern 0: xyz - abcxyz + abcxyz --->abcxyz +0 ^ x +1 ^^ y +2 ^ ^ z - +3 ^ ^ + +3 ^ ^ End of pattern 0: xyz -\= Expect no match +\= Expect no match abc No match - abcxypqr + abcxypqr No match - + /xyz/auto_callout,no_start_optimize - abcxyz + abcxyz --->abcxyz +0 ^ x +0 ^ x @@ -8784,9 +8972,9 @@ No match +0 ^ x +1 ^^ y +2 ^ ^ z - +3 ^ ^ + +3 ^ ^ End of pattern 0: xyz -\= Expect no match +\= Expect no match abc --->abc +0 ^ x @@ -8794,7 +8982,7 @@ No match +0 ^ x +0 ^ x No match - abcxypqr + abcxypqr --->abcxypqr +0 ^ x +0 ^ x @@ -8808,7 +8996,7 @@ No match +0 ^ x +0 ^ x No match - + /(*NO_START_OPT)xyz/auto_callout abcxyz --->abcxyz @@ -8818,9 +9006,9 @@ No match +15 ^ x +16 ^^ y +17 ^ ^ z -+18 ^ ^ ++18 ^ ^ End of pattern 0: xyz - + /(*NO_AUTO_POSSESS)a+b/B ------------------------------------------------------------------ Bra @@ -8831,7 +9019,7 @@ No match ------------------------------------------------------------------ /xyz/auto_callout,no_start_optimize - abcxyz + abcxyz --->abcxyz +0 ^ x +0 ^ x @@ -8839,7 +9027,7 @@ No match +0 ^ x +1 ^^ y +2 ^ ^ z - +3 ^ ^ + +3 ^ ^ End of pattern 0: xyz /^"((?(?=[a])[^"])|b)*"$/auto_callout @@ -8847,28 +9035,28 @@ No match --->"ab" +0 ^ ^ +1 ^ " - +2 ^^ ((?(?=[a])[^"])|b)* - +3 ^^ (?(?=[a])[^"]) - +5 ^^ (?=[a]) + +2 ^^ ( + +3 ^^ (? + +5 ^^ (?= +8 ^^ [a] +11 ^ ^ ) +12 ^^ [^"] +16 ^ ^ ) +17 ^ ^ | - +3 ^ ^ (?(?=[a])[^"]) - +5 ^ ^ (?=[a]) + +3 ^ ^ (? + +5 ^ ^ (?= +8 ^ ^ [a] +17 ^ ^ | +21 ^ ^ " +18 ^ ^ b -+19 ^ ^ ) - +3 ^ ^ (?(?=[a])[^"]) - +5 ^ ^ (?=[a]) ++19 ^ ^ )* + +3 ^ ^ (? + +5 ^ ^ (?= +8 ^ ^ [a] +17 ^ ^ | +21 ^ ^ " +22 ^ ^ $ -+23 ^ ^ ++23 ^ ^ End of pattern 0: "ab" 1: @@ -8889,7 +9077,7 @@ Failed: error 115 at offset 5: reference to non-existent subpattern 3: c 4: d 5: Y - + /Xa{2,4}b/ X\=ps Partial match: X @@ -8901,7 +9089,7 @@ Partial match: Xaa Partial match: Xaaa Xaaaa\=ps Partial match: Xaaaa - + /Xa{2,4}?b/ X\=ps Partial match: X @@ -8913,7 +9101,7 @@ Partial match: Xaa Partial match: Xaaa Xaaaa\=ps Partial match: Xaaaa - + /Xa{2,4}+b/ X\=ps Partial match: X @@ -8925,7 +9113,7 @@ Partial match: Xaa Partial match: Xaaa Xaaaa\=ps Partial match: Xaaaa - + /X\d{2,4}b/ X\=ps Partial match: X @@ -8937,7 +9125,7 @@ Partial match: X33 Partial match: X333 X3333\=ps Partial match: X3333 - + /X\d{2,4}?b/ X\=ps Partial match: X @@ -8949,7 +9137,7 @@ Partial match: X33 Partial match: X333 X3333\=ps Partial match: X3333 - + /X\d{2,4}+b/ X\=ps Partial match: X @@ -8961,7 +9149,7 @@ Partial match: X33 Partial match: X333 X3333\=ps Partial match: X3333 - + /X\D{2,4}b/ X\=ps Partial match: X @@ -8973,7 +9161,7 @@ Partial match: Xaa Partial match: Xaaa Xaaaa\=ps Partial match: Xaaaa - + /X\D{2,4}?b/ X\=ps Partial match: X @@ -8985,7 +9173,7 @@ Partial match: Xaa Partial match: Xaaa Xaaaa\=ps Partial match: Xaaaa - + /X\D{2,4}+b/ X\=ps Partial match: X @@ -8997,7 +9185,7 @@ Partial match: Xaa Partial match: Xaaa Xaaaa\=ps Partial match: Xaaaa - + /X[abc]{2,4}b/ X\=ps Partial match: X @@ -9009,7 +9197,7 @@ Partial match: Xaa Partial match: Xaaa Xaaaa\=ps Partial match: Xaaaa - + /X[abc]{2,4}?b/ X\=ps Partial match: X @@ -9021,7 +9209,7 @@ Partial match: Xaa Partial match: Xaaa Xaaaa\=ps Partial match: Xaaaa - + /X[abc]{2,4}+b/ X\=ps Partial match: X @@ -9033,7 +9221,7 @@ Partial match: Xaa Partial match: Xaaa Xaaaa\=ps Partial match: Xaaaa - + /X[^a]{2,4}b/ X\=ps Partial match: X @@ -9045,7 +9233,7 @@ Partial match: Xzz Partial match: Xzzz Xzzzz\=ps Partial match: Xzzzz - + /X[^a]{2,4}?b/ X\=ps Partial match: X @@ -9057,7 +9245,7 @@ Partial match: Xzz Partial match: Xzzz Xzzzz\=ps Partial match: Xzzzz - + /X[^a]{2,4}+b/ X\=ps Partial match: X @@ -9069,7 +9257,7 @@ Partial match: Xzz Partial match: Xzzz Xzzzz\=ps Partial match: Xzzzz - + /(Y)X\1{2,4}b/ YX\=ps Partial match: YX @@ -9081,7 +9269,7 @@ Partial match: YXYY Partial match: YXYYY YXYYYY\=ps Partial match: YXYYYY - + /(Y)X\1{2,4}?b/ YX\=ps Partial match: YX @@ -9093,7 +9281,7 @@ Partial match: YXYY Partial match: YXYYY YXYYYY\=ps Partial match: YXYYYY - + /(Y)X\1{2,4}+b/ YX\=ps Partial match: YX @@ -9105,7 +9293,7 @@ Partial match: YXYY Partial match: YXYYY YXYYYY\=ps Partial match: YXYYYY - + /\++\KZ|\d+X|9+Y/startchar ++++123999\=ps Partial match: 123999 @@ -9121,7 +9309,7 @@ Partial match: 123999 No match ZA\=ps No match - + /Z(?!)/ \= Expect no match Z\=ps @@ -9134,7 +9322,7 @@ No match 0: dog dogs\=ph Partial match: dogs - + /dog(sbody)??/ dogs\=ps 0: dog @@ -9146,7 +9334,7 @@ Partial match: dogs 0: dog dogs\=ph 0: dog - + /dogsbody|dog/ dogs\=ps 0: dog @@ -9164,7 +9352,7 @@ Partial match: the cat 0: abc abc\=ph 0: abc - + /abc\K123/startchar xyzabc123pqr 0: abc123 @@ -9173,9 +9361,9 @@ Partial match: the cat Partial match: abc12 xyzabc12\=ph Partial match: abc12 - + /(?<=abc)123/ - xyzabc123pqr + xyzabc123pqr 0: 123 xyzabc12\=ps Partial match: abc12 @@ -9280,7 +9468,7 @@ Partial match: +ab No match xyzabcdef\=notempty No match - + /^(?:(?=abc)|abc\K)/aftertext,startchar abcdef 0: @@ -9289,7 +9477,7 @@ No match 0: abc ^^^ 0+ def -\= Expect no match +\= Expect no match abcdef\=notempty No match @@ -9309,7 +9497,7 @@ No match xyz\=notempty_atstart 0: 0+ yz -\= Expect no match +\= Expect no match xyz\=notempty No match @@ -9320,7 +9508,7 @@ No match xyzabc 0: 0+ xyzabc -\= Expect no match +\= Expect no match xyzabc\=notempty No match xyzabc\=notempty_atstart @@ -9329,7 +9517,7 @@ No match No match xyz\=notempty No match - + /^(?<name>a|b\g<name>c)/ aaaa 0: a @@ -9337,7 +9525,7 @@ No match bacxxx 0: bac 1: bac - bbaccxxx + bbaccxxx 0: bbacc 1: bbacc bbbacccxx @@ -9351,7 +9539,7 @@ No match bacxxx 0: bac 1: bac - bbaccxxx + bbaccxxx 0: bbacc 1: bbacc bbbacccxx @@ -9365,7 +9553,7 @@ No match bacxxx 0: bac 1: bac - bbaccxxx + bbaccxxx 0: bbacc 1: bbacc bbbacccxx @@ -9379,7 +9567,7 @@ No match bacxxx 0: bac 1: bac - bbaccxxx + bbaccxxx 0: bbacc 1: bbacc bbbacccxx @@ -9393,7 +9581,7 @@ No match bacxxx 0: bac 1: bac - bbaccxxx + bbaccxxx 0: bbacc 1: bbacc bbbacccxx @@ -9409,7 +9597,7 @@ No match 0: bac 1: bac 2: bac - bbaccxxx + bbaccxxx 0: bbacc 1: bbacc 2: bbacc @@ -9422,7 +9610,7 @@ No match XaaX 0: aa 1: a - XAAX + XAAX 0: AA 1: A @@ -9430,15 +9618,15 @@ No match XaaX 0: aa 1: a -\= Expect no match - XAAX +\= Expect no match + XAAX No match /(?-i:\g<+1>)(?i:(a))/ XaaX 0: aa 1: a - XAAX + XAAX 0: AA 1: A @@ -9448,7 +9636,7 @@ No match abc 0: abc 1: a - accccbbb + accccbbb 0: accccbbb 1: a @@ -9467,27 +9655,26 @@ No match xbaax 0: a 1: a - xzzzax + xzzzax 0: a 1: a /(a)(?<=b\1)/ -Failed: error 125 at offset 10: lookbehind assertion is not fixed length /(a)(?<=b+(?1))/ -Failed: error 125 at offset 13: lookbehind assertion is not fixed length +Failed: error 125 at offset 3: lookbehind assertion is not fixed length /(a+)(?<=b(?1))/ -Failed: error 125 at offset 14: lookbehind assertion is not fixed length +Failed: error 125 at offset 4: lookbehind assertion is not fixed length /(a(?<=b(?1)))/ -Failed: error 125 at offset 13: lookbehind assertion is not fixed length +Failed: error 125 at offset 2: lookbehind assertion is not fixed length /(?<=b(?1))xyz/ Failed: error 115 at offset 8: reference to non-existent subpattern /(?<=b(?1))xyz(b+)pqrstuvew/ -Failed: error 125 at offset 26: lookbehind assertion is not fixed length +Failed: error 125 at offset 0: lookbehind assertion is not fixed length /(a|bc)\1/I Capturing subpattern count = 1 @@ -9534,6 +9721,7 @@ Subject length lower bound = 2 Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'F' Last code unit = ':' Subject length lower bound = 22 @@ -9584,7 +9772,7 @@ Subject length lower bound = 9 (?: [0-9a-f]{1,4} | # 1-4 hex digits or (?(1)0 | () ) ) # if null previously matched, fail; else null : # followed by colon - ){1,7} # end item; 1-7 of them required + ){1,7} # end item; 1-7 of them required [0-9a-f]{1,4} $ # final hex number at end of string (?(1)|.) # check that there was an empty component /Iix @@ -9611,10 +9799,10 @@ Subject length lower bound = 1 C B (1) a (group 1) /(?|(?<a>A)|(?<b>B))/ -Failed: error 165 at offset 15: different names for subpatterns of the same number are not allowed +Failed: error 165 at offset 16: different names for subpatterns of the same number are not allowed /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) | - b(?<quote> (?<apostrophe>')|(?<realquote>")) ) + b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/Ix,dupnames Capturing subpattern count = 6 Max back reference = 4 @@ -9633,7 +9821,7 @@ Subject length lower bound = 3 1: " 2: <unset> 3: " - b"aaaaa + b"aaaaa 0: b"aaaaa 1: <unset> 2: <unset> @@ -9641,12 +9829,12 @@ Subject length lower bound = 3 4: " 5: <unset> 6: " -\= Expect no match +\= Expect no match b"11111 No match - a"11111 + a"11111 No match - + /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/IBx,dupnames ------------------------------------------------------------------ Bra @@ -9685,6 +9873,7 @@ Named capturing subpatterns: D 1 Compile options: dupnames extended Overall options: anchored dupnames extended +Starting code units: a e Subject length lower bound = 2 abcdX 0: abcdX @@ -9698,9 +9887,9 @@ Subject length lower bound = 2 \= Expect no match abcdY No match - ey + ey No match - + /(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/IBx,dupnames ------------------------------------------------------------------ Bra @@ -9741,7 +9930,7 @@ Subject length lower bound = 4 3: c 4: dd \= Expect no match - abcdde + abcdde No match /abcd*/ @@ -9779,29 +9968,6 @@ Partial match: abca xxxxabcde\=ph Partial match: abcde -# 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). - -/(?1)(A(*COMMIT)|B)D/ - ABD - 0: ABD - 1: B - XABD - 0: ABD - 1: B - BAD - 0: BAD - 1: A - ABXABD - 0: ABD - 1: B -\= Expect no match - ABX -No match - BAXBAD -No match - /(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames cat 0: a @@ -9838,7 +10004,7 @@ First code unit = 'i' Subject length lower bound = 1 i 0: i - + /()i(?(1)a)/I Capturing subpattern count = 1 Max back reference = 1 @@ -9862,10 +10028,10 @@ Subject length lower bound = 1 0: ab XAbX 0: Ab - CcC + CcC 0: c \= Expect no match - XABX + XABX No match /(?i)a(?s)b|c/B @@ -9925,7 +10091,7 @@ No match 0: xabcxd 1: abcxd 2: cx - + /^(?&t)*+(?(DEFINE)(?<t>.))$/B ------------------------------------------------------------------ Bra @@ -9950,7 +10116,7 @@ No match Bra ^ Brazero - Once + SBra Recurse KetRmax Cond @@ -9966,9 +10132,9 @@ No match # This one is here because Perl gives the match as "b" rather than "ab". I # believe this to be a Perl bug. - + /(?>a\Kb)z|(ab)/ - ab\=startchar + ab\=startchar 0: ab 1: ab @@ -9977,7 +10143,7 @@ No match 0: 1: 2: - 0abc + 0abc 0: 0 1: 0 2: 0 @@ -9989,9 +10155,9 @@ Failed: error 166 at offset 10: (*MARK) must have an argument Failed: error 166 at offset 6: (*MARK) must have an argument /abc(*FAIL:123)xyz/ -Failed: error 159 at offset 13: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) +Failed: error 159 at offset 10: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) -# This should, and does, fail. In Perl, it does not, which I think is a +# 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/aftertext,mark @@ -10010,7 +10176,7 @@ No match \= Expect no match AC No match - + # Mark names can be duplicated. Perl doesn't give a mark for this one, # though PCRE2 does. @@ -10018,35 +10184,35 @@ No match \= Expect no match XAQQ No match, mark = A - -# COMMIT at the start of a pattern should be the same as an anchor. Perl + +# COMMIT at the start of a pattern should be the same as an anchor. Perl # optimizations defeat this. So does the PCRE2 optimization unless we disable # it. /(*COMMIT)ABC/ ABCDEFG 0: ABC - + /(*COMMIT)ABC/no_start_optimize \= Expect no match DEFGABC No match - + /^(ab (c+(*THEN)cd) | xyz)/x \= Expect no match - abcccd + abcccd No match /^(ab (c+(*PRUNE)cd) | xyz)/x \= Expect no match - abcccd + abcccd No match /^(ab (c+(*FAIL)cd) | xyz)/x \= Expect no match - abcccd + abcccd No match - + # Perl gets some of these wrong /(?>.(*ACCEPT))*?5/ @@ -10083,7 +10249,7 @@ No match \= Expect no match A\nB No match - ACB\n + ACB\n No match /A\NB./Bs @@ -10098,19 +10264,19 @@ No match ------------------------------------------------------------------ ACBD 0: ACBD - ACB\n + ACB\n 0: ACB\x0a \= Expect no match - A\nB + A\nB No match - + /A\NB/newline=crlf A\nB 0: A\x0aB A\rB 0: A\x0dB \= Expect no match - A\r\nB + A\r\nB No match /\R+b/B @@ -10288,7 +10454,7 @@ No match \= Bad offsets abc\=offset=4 Failed: error -33: bad offset value - abc\=offset=-4 + abc\=offset=-4 ** Invalid value in 'offset=-4' \= Valid data abc\=offset=0 @@ -10335,7 +10501,7 @@ Failed: error 168 at offset 3: \c must be followed by a printable ASCII characte Failed: error 142 at offset 29: syntax error in subpattern name (missing terminator) /(?P<abn>(?P=axn)xxx)/B -Failed: error 115 at offset 15: reference to non-existent subpattern +Failed: error 115 at offset 12: reference to non-existent subpattern /(?P<abn>(?P=axn)xxx)(?<axn>yy)/B ------------------------------------------------------------------ @@ -10351,18 +10517,18 @@ Failed: error 115 at offset 15: reference to non-existent subpattern End ------------------------------------------------------------------ -# These tests are here because Perl gets the first one wrong. +# These tests are here because Perl gets the first one wrong. /(\R*)(.)/s \r\n 0: \x0d 1: 2: \x0d - \r\r\n\n\r + \r\r\n\n\r 0: \x0d\x0d\x0a\x0a\x0d 1: \x0d\x0d\x0a\x0a 2: \x0d - \r\r\n\n\r\n + \r\r\n\n\r\n 0: \x0d\x0d\x0a\x0a\x0d 1: \x0d\x0d\x0a\x0a 2: \x0d @@ -10372,11 +10538,11 @@ Failed: error 115 at offset 15: reference to non-existent subpattern 0: \x0d 1: <unset> 2: \x0d - \r\r\n\n\r + \r\r\n\n\r 0: \x0d\x0d\x0a\x0a\x0d 1: \x0a 2: \x0d - \r\r\n\n\r\n + \r\r\n\n\r\n 0: \x0d\x0d\x0a\x0a\x0d 1: \x0a 2: \x0d @@ -10386,16 +10552,16 @@ Failed: error 115 at offset 15: reference to non-existent subpattern 0: \x0d 1: 2: \x0d - \r\r\n\n\r + \r\r\n\n\r 0: \x0d\x0d\x0a\x0a\x0d 1: \x0d\x0d\x0a\x0a 2: \x0d - \r\r\n\n\r\n + \r\r\n\n\r\n 0: \x0d\x0d\x0a\x0a\x0d 1: \x0d\x0d\x0a\x0a 2: \x0d -# ------------- +# ------------- /^abc$/B ------------------------------------------------------------------ @@ -10422,7 +10588,7 @@ Failed: error 115 at offset 15: reference to non-existent subpattern 0: aaaaX 1: a 2: X -\= Expect no match +\= Expect no match aaaa No match @@ -10430,7 +10596,7 @@ No match aaaaX 0: aaaaX 1: X -\= Expect no match +\= Expect no match aaaa No match @@ -10456,18 +10622,20 @@ Last code unit = '4' Subject length lower bound = 5 /(?<=(abc)+)X/ -Failed: error 125 at offset 10: lookbehind assertion is not fixed length +Failed: error 125 at offset 0: lookbehind assertion is not fixed length /(^ab)/I Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 /(^ab)++/I Capturing subpattern count = 1 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 /(^ab|^)+/I @@ -10488,12 +10656,14 @@ Subject length lower bound = 0 Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 /(?:^ab)++/I Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 2 /(?:^ab|^)+/I @@ -10605,7 +10775,7 @@ Subject length lower bound = 1 /(abc)\1+/ -# Perl doesn't get these right IMO (the 3rd is PCRE2-specific) +# Perl doesn't get these right IMO (the 3rd is PCRE2-specific) /(?1)(?:(b(*ACCEPT))){0}/ b @@ -10614,8 +10784,8 @@ Subject length lower bound = 1 /(?1)(?:(b(*ACCEPT))){0}c/ bc 0: bc -\= Expect no match - b +\= Expect no match + b No match /(?1)(?:((*ACCEPT))){0}c/ @@ -10625,7 +10795,7 @@ No match 0: c /^.*?(?(?=a)a|b(*THEN)c)/ -\= Expect no match +\= Expect no match ba No match @@ -10634,20 +10804,20 @@ No match 0: ba /^.*?(?(?=a)a(*THEN)b|c)/ -\= Expect no match +\= Expect no match ac No match /^.*?(?(?=a)a(*THEN)b)c/ -\= Expect no match +\= Expect no match ac No match /^.*?(a(*THEN)b)c/ -\= Expect no match +\= Expect no match aabc No match - + /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x aabc 0: aabc @@ -10670,12 +10840,12 @@ No match 0: C 1: C MK: A -\= Expect no match +\= Expect no match D No match, mark = A - + /(*:A)A+(*SKIP:A)(B|Z)/mark -\= Expect no match +\= Expect no match AAAC No match, mark = A @@ -10686,17 +10856,17 @@ No match, mark = A 0: c c\=notempty 0: c - + /(?1)c(?(DEFINE)((*ACCEPT)b))/ c 0: c c\=notempty 0: c - + /(?>(*ACCEPT)b)c/ c 0: -\= Expect no match +\= Expect no match c\=notempty No match @@ -10711,7 +10881,7 @@ No match ac\=ovector=1 0: ac 0+ - + /(a)(b)x|abc/allaftertext abc\=ovector=2 0: abc @@ -10744,7 +10914,8 @@ Matched, but too many substrings /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/I Capturing subpattern count = 2 -Subject length lower bound = 1 +May match empty string +Subject length lower bound = 0 /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/I Capturing subpattern count = 2 @@ -10783,7 +10954,7 @@ Subject length lower bound = 6 1: <unset> 2: <unset> 3: baz - foobarbazX + foobarbazX 0: bazX 1: <unset> 2: <unset> @@ -10966,26 +11137,26 @@ Matched, but too many substrings adz --->adz +0 ^ ^ - +1 ^ (a(*:A)(d|e(*:B))z|aeq) + +1 ^ ( +2 ^ a +3 ^^ (*:A) - +8 ^^ (d|e(*:B)) + +8 ^^ ( Latest Mark: A +9 ^^ d +10 ^ ^ | +18 ^ ^ z +19 ^ ^ | -+24 ^ ^ ++24 ^ ^ End of pattern 0: adz 1: adz 2: d aez --->aez +0 ^ ^ - +1 ^ (a(*:A)(d|e(*:B))z|aeq) + +1 ^ ( +2 ^ a +3 ^^ (*:A) - +8 ^^ (d|e(*:B)) + +8 ^^ ( Latest Mark: A +9 ^^ d +11 ^^ e @@ -10994,17 +11165,17 @@ Latest Mark: A Latest Mark: B +18 ^ ^ z +19 ^ ^ | -+24 ^ ^ ++24 ^ ^ End of pattern 0: aez 1: aez 2: e aeqwerty --->aeqwerty +0 ^ ^ - +1 ^ (a(*:A)(d|e(*:B))z|aeq) + +1 ^ ( +2 ^ a +3 ^^ (*:A) - +8 ^^ (d|e(*:B)) + +8 ^^ ( Latest Mark: A +9 ^^ d +11 ^^ e @@ -11016,7 +11187,7 @@ Latest Mark: B +21 ^^ e +22 ^ ^ q +23 ^ ^ ) -+24 ^ ^ ++24 ^ ^ End of pattern 0: aeq 1: aeq @@ -11083,7 +11254,7 @@ Subject length lower bound = 0 ------------------------------------------------------------------ Bra ^ - Once_NC + Once a++ Ket Once @@ -11099,7 +11270,7 @@ Subject length lower bound = 0 0: aaaazzzzb 1: zzzz \= Expect no match - aazz + aazz No match /(.)(\1|a(?2))/ @@ -11107,15 +11278,15 @@ No match 0: bab 1: b 2: ab - + /\1|(.)(?R)\1/ cbbbc 0: cbbbc 1: c - + /(.)((?(1)c|a)|a(?2))/ \= Expect no match - baa + baa No match /(?P<abn>(?P=abn)xxx)/B @@ -11223,14 +11394,14 @@ No match ------------------------------------------------------------------ /a[\NB]c/ -Failed: error 171 at offset 3: \N is not supported in a class +Failed: error 171 at offset 4: \N is not supported in a class aNc - + /a[B-\Nc]/ -Failed: error 150 at offset 5: invalid range in character class +Failed: error 150 at offset 6: invalid range in character class /a[B\Nc]/ -Failed: error 171 at offset 4: \N is not supported in a class +Failed: error 171 at offset 5: \N is not supported in a class /(a)(?2){0,1999}?(b)/ @@ -11239,14 +11410,14 @@ Failed: error 171 at offset 4: \N is not supported in a class # This test, with something more complicated than individual letters, causes # different behaviour in Perl. Perhaps it disables some optimization; no tag is # passed back for the failures, whereas in PCRE2 there is a tag. - + /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/x,mark AABC 0: AB 1: A 2: B MK: A - XXYZ + XXYZ 0: XXY 1: <unset> 2: <unset> @@ -11255,40 +11426,40 @@ MK: A 5: Y MK: B \= Expect no match - XAQQ + XAQQ No match, mark = A - XAQQXZZ + XAQQXZZ No match, mark = A - AXQQQ + AXQQQ No match, mark = A - AXXQQQ + AXXQQQ No match, mark = B # Perl doesn't give marks for these, though it does if the alternatives are -# replaced by single letters. - +# replaced by single letters. + /(b|q)(*:m)f|a(*:n)w/mark - aw + aw 0: aw MK: n -\= Expect no match +\= Expect no match abc No match, mark = m /(q|b)(*:m)f|a(*:n)w/mark - aw + aw 0: aw MK: n -\= Expect no match +\= Expect no match abc No match, mark = m -# After a partial match, the behaviour is as for a failure. +# After a partial match, the behaviour is as for a failure. /^a(*:X)bcde/mark abc\=ps Partial match, mark=X: abc - + # These are here because Perl doesn't return a mark, except for the first. /(?=(*:x))(q|)/aftertext,mark @@ -11418,7 +11589,7 @@ Partial match: ababa abababx 0: abababx 1: ab - ababababx + ababababx 0: ababababx 1: ab @@ -11432,10 +11603,10 @@ Partial match: ababa abababx 0: abababx 1: ab - ababababx + ababababx 0: ababababx 1: ab - + /^(..)(\1{2,3})ab/ abababab 0: abababab @@ -11447,7 +11618,7 @@ Partial match: ababa 0: \x0d \r\=ph Partial match: \x0d - + /^\R{2,3}x/ \r\=ps Partial match: \x0d @@ -11463,7 +11634,7 @@ Partial match: \x0d\x0d\x0d Partial match: \x0d\x0d\x0d \r\rx 0: \x0d\x0dx - \r\r\rx + \r\r\rx 0: \x0d\x0d\x0dx /^\R{2,3}?x/ @@ -11481,9 +11652,9 @@ Partial match: \x0d\x0d\x0d Partial match: \x0d\x0d\x0d \r\rx 0: \x0d\x0dx - \r\r\rx + \r\r\rx 0: \x0d\x0d\x0dx - + /^\R?x/ \r\=ps Partial match: \x0d @@ -11491,7 +11662,7 @@ Partial match: \x0d Partial match: \x0d x 0: x - \rx + \rx 0: \x0dx /^\R+x/ @@ -11503,7 +11674,7 @@ Partial match: \x0d Partial match: \x0d\x0a \r\n\=ph Partial match: \x0d\x0a - \rx + \rx 0: \x0dx /^a$/newline=crlf @@ -11537,7 +11708,7 @@ Partial match: a\x0d 0: \x0d \r\=ph Partial match: \x0d - + /.{2,3}/newline=crlf \r\=ps Partial match: \x0d @@ -11570,9 +11741,9 @@ Partial match: \x0d\x0d ABCDGHI\=ovector=01 Matched, but too many substrings 0: ABCD - + # These are all run as real matches in test 1; here we are just checking the -# settings of the anchored and startline bits. +# settings of the anchored and startline bits. /(?>.*?a)(?<=ba)/I Capturing subpattern count = 0 @@ -11602,6 +11773,7 @@ Subject length lower bound = 2 Capturing subpattern count = 0 Compile options: dotall Overall options: anchored dotall +First code unit = 'a' Subject length lower bound = 2 /.*?a(*SKIP)b/I @@ -11624,6 +11796,7 @@ Subject length lower bound = 2 Capturing subpattern count = 0 Compile options: dotall Overall options: anchored dotall +First code unit = 'a' Subject length lower bound = 2 /(?>.*?)(?<=(abcd)|(wxyz))/I @@ -11671,43 +11844,36 @@ Subject length lower bound = 3 /(?:(a)+(?C1)bb|aa(?C2)b)/ aab\=callout_capture Callout 1: last capture = 1 - 0: <unset> 1: a --->aab ^ ^ b Callout 1: last capture = 1 - 0: <unset> 1: a --->aab ^^ b Callout 2: last capture = 0 - 0: <unset> --->aab ^ ^ b 0: aab - + /(?:(a)++(?C1)bb|aa(?C2)b)/ aab\=callout_capture Callout 1: last capture = 1 - 0: <unset> 1: a --->aab ^ ^ b Callout 2: last capture = 0 - 0: <unset> --->aab ^ ^ b 0: aab - + /(?:(?>(a))(?C1)bb|aa(?C2)b)/ aab\=callout_capture Callout 1: last capture = 1 - 0: <unset> 1: a --->aab ^^ b Callout 2: last capture = 0 - 0: <unset> --->aab ^ ^ b 0: aab @@ -11715,15 +11881,12 @@ Callout 2: last capture = 0 /(?:(?1)(?C1)x|ab(?C2))((a)){0}/ aab\=callout_capture Callout 1: last capture = 0 - 0: <unset> --->aab ^^ x Callout 1: last capture = 0 - 0: <unset> --->aab ^^ x Callout 2: last capture = 0 - 0: <unset> --->aab ^ ^ ) 0: ab @@ -11731,45 +11894,39 @@ Callout 2: last capture = 0 /(?1)(?C1)((a)(?C2)){0}/ aab\=callout_capture Callout 2: last capture = 2 - 0: <unset> 1: <unset> 2: a --->aab - ^^ ) + ^^ ){0} Callout 1: last capture = 0 - 0: <unset> --->aab - ^^ ((a)(?C2)){0} + ^^ ( 0: a /(?:(a)+(?C1)bb|aa(?C2)b)++/ aab\=callout_capture Callout 1: last capture = 1 - 0: <unset> 1: a --->aab ^ ^ b Callout 1: last capture = 1 - 0: <unset> 1: a --->aab ^^ b Callout 2: last capture = 0 - 0: <unset> --->aab ^ ^ b 0: aab aab\=callout_capture,ovector=1 Callout 1: last capture = 1 - 0: <unset> + 1: a --->aab ^ ^ b Callout 1: last capture = 1 - 0: <unset> + 1: a --->aab ^^ b Callout 2: last capture = 0 - 0: <unset> --->aab ^ ^ b 0: aab @@ -11779,7 +11936,7 @@ Callout 2: last capture = 0 0: ab ab\=ovector=1 0: ab - + /(?<=123)(*MARK:xx)abc/mark xxxx123a\=ph Partial match, mark=xx: 123a @@ -11787,7 +11944,7 @@ Partial match, mark=xx: 123a xxxx123a\=ps Partial match, mark=xx: 123a <<< - + /123\Kabc/startchar xxxx123a\=ph Partial match: 123a @@ -11798,26 +11955,26 @@ Partial match: 123a bb --->bb +0 ^ ^ - +1 ^ (?(?=a)aa|bb) - +3 ^ (?=a) + +1 ^ (? + +3 ^ (?= +6 ^ a +11 ^ b +12 ^^ b +13 ^ ^ ) -+14 ^ ^ ++14 ^ ^ End of pattern 0: bb /(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/ bb --->bb 1 ^ ^ - 2 ^ (?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10)) - 99 ^ (?=(?C3)a(?C4)) + 2 ^ (? + 99 ^ (?= 3 ^ a 8 ^ b 9 ^^ b 10 ^ ^ ) - 11 ^ ^ + 11 ^ ^ End of pattern 0: bb # Perl seems to have a bug with this one. @@ -11825,18 +11982,18 @@ Partial match: 123a /aaaaa(*COMMIT)(*PRUNE)b|a+c/ aaaaaac 0: aaaac - + # Here are some that Perl treats differently because of the way it handles -# backtracking verbs. +# backtracking verbs. /(?!a(*COMMIT)b)ac|ad/ ac 0: ac - ad + ad 0: ad /^(?!a(*THEN)b|ac)../ - ad + ad 0: ad \= Expect no match ac @@ -11845,7 +12002,7 @@ No match /^(?=a(*THEN)b|ac)/ ac 0: - + /\A.*?(?:a|b(*THEN)c)/ ba 0: ba @@ -11859,7 +12016,7 @@ No match 0: ba /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/ - aac + aac 0: aac /\A.*?(a|b(*THEN)c)/ @@ -11868,24 +12025,23 @@ No match 1: a /^(A(*THEN)B|A(*THEN)D)/ - AD + AD 0: AD 1: AD - + /(?!b(*THEN)a)bn|bnn/ bnn 0: bn /(?(?=b(*SKIP)a)bn|bnn)/ -\= Expect no match bnn -No match + 0: bnn /(?=b(*THEN)a|)bn|bnn/ bnn 0: bn -# This test causes a segfault with Perl 5.18.0 +# This test causes a segfault with Perl 5.18.0 /^(?=(a)){0}b(?1)/ backgammon @@ -12545,7 +12701,7 @@ Subject length lower bound = 5 Ket a CBraPos 1 - a++ + a+ KetRpos a Ket @@ -12568,7 +12724,7 @@ Subject length lower bound = 5 cc Ket a++ - Once_NC + Once bb Alt cc @@ -12917,7 +13073,7 @@ Subject length lower bound = 5 ------------------------------------------------------------------ Bra [a-f]*+ - Once_NC + Once gg Alt hh @@ -12925,7 +13081,7 @@ Subject length lower bound = 5 # [a-f]*+ Brazero - Once_NC + Once gg Alt hh @@ -12933,7 +13089,7 @@ Subject length lower bound = 5 # [a-f]* Brazero - Once_NC + Once gg Alt hh @@ -12941,7 +13097,7 @@ Subject length lower bound = 5 a# [a-f]*+ Brazero - Once_NC + Once gg Alt hh @@ -13016,15 +13172,15 @@ Starting code units: a b c d Last code unit = 'd' Subject length lower bound = 1 -# End of special auto-possessive tests +# End of special auto-possessive tests /^A\o{1239}B/ Failed: error 164 at offset 8: non-octal character in \o{} (closing brace missing?) A\123B /^A\oB/ -Failed: error 155 at offset 3: missing opening brace after \o - +Failed: error 155 at offset 4: missing opening brace after \o + /^A\x{zz}B/ Failed: error 167 at offset 5: non-hex character in \x{} (closing brace missing?) @@ -13032,7 +13188,7 @@ Failed: error 167 at offset 5: non-hex character in \x{} (closing brace missing? Failed: error 167 at offset 7: non-hex character in \x{} (closing brace missing?) /^A\x{/ -Failed: error 167 at offset 5: non-hex character in \x{} (closing brace missing?) +Failed: error 178 at offset 5: digits missing in \x{} or \o{} /[ab]++/B,no_auto_possess ------------------------------------------------------------------ @@ -13067,16 +13223,16 @@ Failed: error 167 at offset 5: non-hex character in \x{} (closing brace missing? ------------------------------------------------------------------ /[a-[:digit:]]+/ -Failed: error 150 at offset 3: invalid range in character class +Failed: error 150 at offset 4: invalid range in character class /[A-[:digit:]]+/ -Failed: error 150 at offset 3: invalid range in character class +Failed: error 150 at offset 4: invalid range in character class /[a-[.xxx.]]+/ -Failed: error 150 at offset 3: invalid range in character class +Failed: error 150 at offset 4: invalid range in character class /[a-[=xxx=]]+/ -Failed: error 150 at offset 3: invalid range in character class +Failed: error 150 at offset 4: invalid range in character class /[a-[!xxx!]]+/ Failed: error 108 at offset 3: range out of order in character class @@ -13086,13 +13242,13 @@ Failed: error 108 at offset 3: range out of order in character class 0: A]]] /[a-\d]+/ -Failed: error 150 at offset 4: invalid range in character class +Failed: error 150 at offset 5: invalid range in character class /(?<0abc>xx)/ Failed: error 144 at offset 3: group name must start with a non-digit /(?&1abc)xx(?<1abc>y)/ -Failed: error 144 at offset 13: group name must start with a non-digit +Failed: error 144 at offset 3: group name must start with a non-digit /(?<ab-cd>xx)/ Failed: error 142 at offset 5: syntax error in subpattern name (missing terminator) @@ -13116,13 +13272,13 @@ Failed: error 144 at offset 3: group name must start with a non-digit Failed: error 144 at offset 4: group name must start with a non-digit /\g{4df}/ -Failed: error 144 at offset 3: group name must start with a non-digit +Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number /(?&1abc)xx(?<1abc>y)/ -Failed: error 144 at offset 13: group name must start with a non-digit +Failed: error 144 at offset 3: group name must start with a non-digit /(?P>1abc)xx(?<1abc>y)/ -Failed: error 144 at offset 14: group name must start with a non-digit +Failed: error 144 at offset 4: group name must start with a non-digit /\g'3gh'/ Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number @@ -13137,7 +13293,7 @@ Failed: error 144 at offset 4: group name must start with a non-digit Failed: error 144 at offset 4: group name must start with a non-digit /(?(4gh)abc)/ -Failed: error 126 at offset 4: malformed number or name after (?( +Failed: error 124 at offset 4: missing closing parenthesis for condition /(?(R&6yh)abc)/ Failed: error 144 at offset 5: group name must start with a non-digit @@ -13186,18 +13342,18 @@ Failed: error 144 at offset 5: group name must start with a non-digit ------------------------------------------------------------------ little red riding hood 0: red - a /red/ thing + a /red/ thing 0: red red is a colour 0: red - put it all on red + put it all on red 0: red \= Expect no match no reduction No match Alfred Winifred No match - + /[a[:<:]] should give error/ Failed: error 130 at offset 4: unknown POSIX class name @@ -13211,14 +13367,14 @@ Start of matched string is beyond its end - displaying from end to start. \= Expect no match xx\nxabcd No match - + # Test stack guard external calls. /(((a)))/stackguard=1 -Failed: error 133 at offset 2: parentheses are too deeply nested (stack check) +Failed: error 133 at offset 7: parentheses are too deeply nested (stack check) /(((a)))/stackguard=2 -Failed: error 133 at offset 3: parentheses are too deeply nested (stack check) +Failed: error 133 at offset 7: parentheses are too deeply nested (stack check) /(((a)))/stackguard=3 @@ -13231,7 +13387,7 @@ Failed: error 133 at offset 3: parentheses are too deeply nested (stack check) Bra ^ \w+ - Once_NC + Once \s*+ Ket AssertB @@ -13243,10 +13399,10 @@ Failed: error 133 at offset 3: parentheses are too deeply nested (stack check) ------------------------------------------------------------------ /\othing/ -Failed: error 155 at offset 1: missing opening brace after \o +Failed: error 155 at offset 2: missing opening brace after \o /\o{}/ -Failed: error 178 at offset 1: digits missing in \x{} or \o{} +Failed: error 178 at offset 3: digits missing in \x{} or \o{} /\o{whatever}/ Failed: error 164 at offset 3: non-octal character in \o{} (closing brace missing?) @@ -13265,9 +13421,9 @@ Failed: error 115 at offset 2: reference to non-existent subpattern /A\9B/ Failed: error 115 at offset 2: reference to non-existent subpattern -# This one is here because Perl fails to match "12" for this pattern when the $ +# This one is here because Perl fails to match "12" for this pattern when the $ # is present. - + /^(?(?=abc)\w{3}:|\d\d)$/ abc: 0: abc: @@ -13276,10 +13432,10 @@ Failed: error 115 at offset 2: reference to non-existent subpattern \= Expect no match 123 No match - xyz + xyz No match -# Perl gets this one wrong, giving "a" as the after text for ca and failing to +# Perl gets this one wrong, giving "a" as the after text for ca and failing to # match for cd. /(?(?=ab)ab)/aftertext @@ -13289,11 +13445,11 @@ No match ca 0: 0+ ca - cd + cd 0: 0+ cd - -# This should test both paths for processing OP_RECURSE. + +# This should test both paths for processing OP_RECURSE. /(?(R)a+|(?R)b)/ aaaabcde @@ -13310,14 +13466,14 @@ No match 0: a ba 0: b - cb + cb 0: b /(*NOTEMPTY_ATSTART)a*?b*?/aftertext ab 0: a 0+ b - cdab + cdab 0: 0+ dab @@ -13326,7 +13482,7 @@ Capturing subpattern count = 0 Subject length lower bound = 2 yesno 0: yes - + /(?(VERSION=8)yes){3}/BI,aftertext ------------------------------------------------------------------ Bra @@ -13350,7 +13506,7 @@ Subject length lower bound = 6 yesnononoyes 0: nonono \= Expect no match - yesno + yesno No match /(?:(?<VERSION>abc)|xyz)(?(VERSION)yes|no)/I @@ -13368,20 +13524,20 @@ Subject length lower bound = 5 \= Expect no match abcno No match - xyzyes + xyzyes No match /(?(VERSION<10)yes|no)/ -Failed: error 179 at offset 10: syntax error in (?(VERSION condition +Failed: error 179 at offset 10: syntax error or number too big in (?(VERSION condition /(?(VERSION>10)yes|no)/ -Failed: error 179 at offset 11: syntax error in (?(VERSION condition +Failed: error 179 at offset 11: syntax error or number too big in (?(VERSION condition /(?(VERSION>=10.0.0)yes|no)/ -Failed: error 179 at offset 16: syntax error in (?(VERSION condition +Failed: error 179 at offset 16: syntax error or number too big in (?(VERSION condition /(?(VERSION=10.101)yes|no)/ -Failed: error 179 at offset 17: syntax error in (?(VERSION condition +Failed: error 179 at offset 17: syntax error or number too big in (?(VERSION condition /abcd/I Capturing subpattern count = 0 @@ -13402,18 +13558,17 @@ Subject length lower bound = 1 abd 0: abd 1: ab - xyd + xyd 0: d /(|ab)*?d/I,no_start_optimize Capturing subpattern count = 1 Options: no_start_optimize -Last code unit = 'd' Subject length lower bound = 0 abd 0: abd 1: ab - xyd + xyd 0: d /\k<A>*(?<A>aa)(?<A>bb)/match_unset_backref,dupnames @@ -13500,7 +13655,7 @@ Failed: error -58 at offset 4 in replacement: expected closing curly bracket in /abc/replace=[9]XYZ 123abc123 Failed: error -48: no more memory - + /abc/replace=xyz 1abc2\=partial_hard Failed: error -34: bad option value @@ -13518,29 +13673,29 @@ Failed: error -34: bad option value /(?<=abc)(|def)/g,replace=<$0> 123abcxyzabcdef789abcpqr 4: 123abc<>xyzabc<><def>789abc<>pqr - + /./replace=$0 a 1: a - + /(.)(.)/replace=$2+$1 abc 1: b+ac - + /(?<A>.)(?<B>.)/replace=$B+$A abc 1: b+ac - + /(.)(.)/g,replace=$2$1 - abcdefgh + abcdefgh 4: badcfehg - + /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=${*MARK} apple lemon blackberry 3: pear orange strawberry apple strudel 1: pear strudel - fruitless + fruitless 0: fruitless /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/replace=${*MARK} sauce, @@ -13552,10 +13707,10 @@ Failed: error -34: bad option value 3: <pear> <orange> <strawberry> apple strudel 1: <pear> strudel - fruitless + fruitless 0: fruitless - -/(*:pear)apple/g,replace=${*MARKING} + +/(*:pear)apple/g,replace=${*MARKING} apple lemon blackberry Failed: error -35 at offset 11 in replacement: invalid replacement string @@ -13563,7 +13718,7 @@ Failed: error -35 at offset 11 in replacement: invalid replacement string apple lemon blackberry Failed: error -58 at offset 7 in replacement: expected closing curly bracket in replacement string -/(*:pear)apple/g,replace=${*mark} +/(*:pear)apple/g,replace=${*mark} apple lemon blackberry Failed: error -35 at offset 8 in replacement: invalid replacement string @@ -13627,13 +13782,13 @@ Get substring 3 failed (-54): requested value is not available Get substring 4 failed (-49): unknown substring 0L c 1L - + /x(?=ab\K)/ - xab\=get=0 + xab\=get=0 Start of matched string is beyond its end - displaying from end to start. 0: ab 0G (0) - xab\=copy=0 + xab\=copy=0 Start of matched string is beyond its end - displaying from end to start. 0: ab 0C (0) @@ -13674,12 +13829,14 @@ get substring list failed (-2): partial match Capturing subpattern count = 0 Compile options: <none> Overall options: anchored +First code unit = 'a' Subject length lower bound = 3 /^abc/info,no_dotstar_anchor Capturing subpattern count = 0 Compile options: no_dotstar_anchor Overall options: anchored no_dotstar_anchor +First code unit = 'a' Subject length lower bound = 3 /.*\d/info,auto_callout @@ -13797,7 +13954,7 @@ Failed: error 109 at offset 7: quantifier does not follow a repeatable item 456 0: 456 \= Expect no match - 356 + 356 No match '^(a)*+(\w)' @@ -13805,7 +13962,7 @@ No match 0: g 1: <unset> 2: g - g\=ovector=1 + g\=ovector=1 Matched, but too many substrings 0: g @@ -13813,10 +13970,10 @@ Matched, but too many substrings g 0: g 1: g - g\=ovector=1 + g\=ovector=1 Matched, but too many substrings 0: g - + # These two pattern showeds up compile-time bugs "((?2){0,1999}())?" @@ -13897,7 +14054,6 @@ Callout (10): "AB" /^a(b)c(?C1)def/ abcdef\=callout_capture Callout 1: last capture = 1 - 0: <unset> 1: b --->abcdef ^ ^ d @@ -13920,7 +14076,6 @@ Callout 1: last capture = 1 ------------------------------------------------------------------ abcdef\=callout_capture Callout (10): {AB} last capture = 1 - 0: <unset> 1: b --->abcdef ^ ^ d @@ -13955,15 +14110,15 @@ Callout {a}b} Bra Bra a - CalloutStr `code` 8 14 0 + CalloutStr `code` 8 14 4 Ket Bra a - CalloutStr `code` 8 14 0 + CalloutStr `code` 8 14 4 Ket Bra a - CalloutStr `code` 8 14 0 + CalloutStr `code` 8 14 4 Ket Ket End @@ -13974,7 +14129,7 @@ Callout {a}b} Bra ^ Cond - Callout 25 9 7 + Callout 25 9 3 Assert abc Ket @@ -13985,14 +14140,14 @@ Callout {a}b} Ket End ------------------------------------------------------------------ -Callout 25 (?=abc) +Callout 25 (?= abcdefg --->abcdefg - 25 ^ (?=abc) + 25 ^ (?= 0: abcd - xyz123 + xyz123 --->xyz123 - 25 ^ (?=abc) + 25 ^ (?= 0: xyz /^(?(?C$abc$)(?=abc)abcd|xyz)/B @@ -14000,7 +14155,7 @@ Callout 25 (?=abc) Bra ^ Cond - CalloutStr $abc$ 7 12 7 + CalloutStr $abc$ 7 12 3 Assert abc Ket @@ -14014,12 +14169,12 @@ Callout 25 (?=abc) abcdefg Callout (7): $abc$ --->abcdefg - ^ (?=abc) + ^ (?= 0: abcd - xyz123 + xyz123 Callout (7): $abc$ --->xyz123 - ^ (?=abc) + ^ (?= 0: xyz /^ab(?C'first')cd(?C"second")ef/ @@ -14036,13 +14191,13 @@ Callout (20): "second" aaaXY Callout (8): `code` --->aaaXY - ^^ ) + ^^ ){3} Callout (8): `code` --->aaaXY - ^ ^ ) + ^ ^ ){3} Callout (8): `code` --->aaaXY - ^ ^ ) + ^ ^ ){3} 0: aaaX # Binary zero in callout string @@ -14060,8 +14215,8 @@ Callout (5): 'x\x00z' /(?(?!)a|b)/ bbb 0: b -\= Expect no match - aaa +\= Expect no match + aaa No match # JIT gives a different error message for the infinite recursion @@ -14073,7 +14228,7 @@ Failed: error -52: nested recursion at the same subject position # Perl fails to diagnose the absence of an assertion "(?(?<E>.*!.*)?)" -Failed: error 128 at offset 3: assertion expected after (?( or (?(?C) +Failed: error 128 at offset 2: assertion expected after (?( or (?(?C) "X((?2)()*+){2}+"B ------------------------------------------------------------------ @@ -14124,7 +14279,7 @@ Failed: error 115 at offset 15: reference to non-existent subpattern Failed: error 115 at offset 15: reference to non-existent subpattern ";(?<=()((?3))((?2)))" -Failed: error 125 at offset 20: lookbehind assertion is not fixed length +Failed: error 125 at offset 1: lookbehind assertion is not fixed length # Perl loops on this (PCRE2 used to!) @@ -14163,9 +14318,9 @@ Subject length lower bound = 0 \= Expect no match \[9x!xxx(]{9999} No match - + /(abc)*/ - \[abc]{5} + \[abc]{5} 0: abcabcabcabcabc 1: abc @@ -14211,7 +14366,7 @@ Failed: error 115 at offset 2: reference to non-existent subpattern /A\8B\9C/ Failed: error 115 at offset 2: reference to non-existent subpattern A8B9C - + /(?x:((?'a')) # comment (with parentheses) and | vertical (?-x:#not a comment (?'b')) # this is a comment () (?'c')) # not a comment (?'d')/info @@ -14239,14 +14394,14 @@ Subject length lower bound = 1 1: 2: 2 3: - B32A + B32A 0: 3 1: 2: 3: 3 # These are some patterns that used to cause buffer overflows or other errors -# while compiling. +# while compiling. /.((?2)(?R)|\1|$)()/B ------------------------------------------------------------------ @@ -14306,7 +14461,7 @@ Failed: error 115 at offset 7: reference to non-existent subpattern "(?J)(?'d'(?'d'\g{d}))" "(?=!((?2)(?))({8(?<=(?1){29}8bbbb\x16\xd\xc6^($(\xa9H4){4}h}?1)B))\x15')" -Failed: error 125 at offset 72: lookbehind assertion is not fixed length +Failed: error 125 at offset 16: lookbehind assertion is not fixed length /A(?'')Z/ Failed: error 162 at offset 4: subpattern name expected @@ -14314,7 +14469,7 @@ Failed: error 162 at offset 4: subpattern name expected "(?J:(?|(?'R')(\k'R')|((?'R'))))" /(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/ -Failed: error 161 at offset 32: number is too big +Failed: error 161 at offset 17: group number is too big /^(?:(?(1)x|)+)+$()/B ------------------------------------------------------------------ @@ -14335,16 +14490,16 @@ Failed: error 161 at offset 32: number is too big ------------------------------------------------------------------ /[[:>:]](?<)/ -Failed: error 124 at offset 10: letter or underscore expected after (?< or (?' +Failed: error 162 at offset 10: subpattern name expected /((?x)(*:0))#(?'/ -Failed: error 124 at offset 15: letter or underscore expected after (?< or (?' +Failed: error 162 at offset 15: subpattern name expected /(?C$[$)(?<]/ -Failed: error 124 at offset 10: letter or underscore expected after (?< or (?' +Failed: error 162 at offset 10: subpattern name expected /(?C$)$)(?<]/ -Failed: error 124 at offset 10: letter or underscore expected after (?< or (?' +Failed: error 162 at offset 10: subpattern name expected /(?(R))*+/B ------------------------------------------------------------------ @@ -14362,7 +14517,7 @@ Failed: error 124 at offset 10: letter or underscore expected after (?< or (?' 0: /((?x)(?#))#(?'/ -Failed: error 124 at offset 14: letter or underscore expected after (?< or (?' +Failed: error 162 at offset 14: subpattern name expected /((?x)(?#))#(?'abc')/I Capturing subpattern count = 2 @@ -14372,7 +14527,7 @@ First code unit = '#' Subject length lower bound = 1 /[[:\\](?<[::]/ -Failed: error 124 at offset 9: letter or underscore expected after (?< or (?' +Failed: error 162 at offset 9: subpattern name expected /[[:\\](?'abc')[a:]/I Capturing subpattern count = 1 @@ -14401,13 +14556,13 @@ Failed: error 106 at offset 353: missing terminating ] for character class ------------------------------------------------------------------ /(?R-:(?</ -Failed: error 114 at offset 8: missing closing parenthesis +Failed: error 158 at offset 3: (?R (recursive pattern call) must be followed by a closing parenthesis /(?R-:(?<)/ -Failed: error 129 at offset 3: (?R or (?[+-]digits must be followed by ) +Failed: error 158 at offset 3: (?R (recursive pattern call) must be followed by a closing parenthesis /(?(?C{\Q})(?!(?'/ -Failed: error 124 at offset 16: letter or underscore expected after (?< or (?' +Failed: error 162 at offset 16: subpattern name expected /(?(?C{\Q})(?!(?'abc')))/I Capturing subpattern count = 1 @@ -14478,7 +14633,7 @@ Subject length lower bound = 0 0: {4,5a}bc /\x0{ab}/ - \0{ab} + \0{ab} 0: \x00{ab} /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ @@ -14505,10 +14660,10 @@ No match 0: ab /(?(8000000000/ -Failed: error 114 at offset 13: missing closing parenthesis +Failed: error 161 at offset 8: group number is too big /((?(R8000000000)))/ -Failed: error 161 at offset 16: number is too big +Failed: error 161 at offset 9: group number is too big /0(?0)|(1)(*THEN)(*SKIP:0)(*FAIL)/ \= Expect no match @@ -14516,7 +14671,7 @@ Failed: error 161 at offset 16: number is too big No match /(?(1)()\983040\2)/ -Failed: error 115 at offset 13: reference to non-existent subpattern +Failed: error 161 at offset 14: group number is too big /(*LIMIT_MATCH=)abc/ Failed: error 160 at offset 14: (*VERB) not recognized or malformed @@ -14538,9 +14693,9 @@ No match aacb No match -/(*MARK:a\zb)z/alt_verbnames -Failed: error 140 at offset 9: invalid escape sequence in (*VERB) name - +/(*MARK:a\zb)z/alt_verbnames +Failed: error 140 at offset 10: invalid escape sequence in (*VERB) name + /(*:ab\t(d\)c)xxx/ Failed: error 122 at offset 12: unmatched closing parenthesis @@ -14553,20 +14708,38 @@ MK: ab\x09(d)c x 0: x MK: Axx)xB - + /(*:A\ExxxB)x/alt_verbnames,mark - x + x 0: x MK: AxxxB - + /(*: A \ and #comment \ B)x/x,alt_verbnames,mark - x + x 0: x MK: A and B - + +/(*: A \ and #comment + \ B)x/alt_verbnames,mark + x + 0: x +MK: A and #comment\x0a B + +/(*: A \ and #comment + \ B)x/x,mark + x + 0: x +MK: A \ and #comment\x0a \ B + +/(*: A \ and #comment + \ B)x/mark + x + 0: x +MK: A \ and #comment\x0a \ B + /(*:A -B)x/alt_verbnames,mark +B)x/alt_verbnames,mark x 0: x MK: A\x0aB @@ -14595,7 +14768,7 @@ No match \= Expect no match 1234abc\=offset_limit=6 No match - + /A/g,replace=-,use_offset_limit XAXAXAXAXA\=offset_limit=4 2: X-X-XAXAXA @@ -14614,20 +14787,20 @@ No match /abcd/null_context abcd\=null_context 0: abcd -\= Expect error +\= Expect error abcd\=null_context,find_limits ** Not allowed together: find_limits null_context - abcd\=allusedtext,startchar + abcd\=allusedtext,startchar ** Not allowed together: allusedtext startchar /abcd/replace=w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$),substitute_extended abcd 1: w\x0dx\x82y\xdbz(12\$34$$\x345$) - + /a(bc)(DE)/replace=a\u$1\U$1\E$1\l$2\L$2\Eab\Uab\LYZ\EDone,substitute_extended abcDE 1: aBcBCbcdEdeabAByzDone - + /abcd/replace=xy\kz,substitute_extended abcd Failed: error -57 at offset 4 in replacement: bad escape sequence in replacement string @@ -14681,9 +14854,9 @@ Failed: error -49 at offset 10 in replacement: unknown substring /(?J)(?:(?<A>a)|(?<A>b))/replace=<$A> [a] 1: [<a>] - [b] + [b] 1: [<b>] -\= Expect error +\= Expect error (a)\=ovector=1 Failed: error -54 at offset 3 in replacement: requested value is not available @@ -14701,6 +14874,7 @@ Capturing subpattern count = 2 Max back reference = 1 Compile options: <none> Overall options: anchored +First code unit = 'o' Last code unit = '}' Subject length lower bound = 65535 @@ -14715,7 +14889,7 @@ Failed: error 142 at offset 7: syntax error in subpattern name (missing terminat Failed: error -49 at offset 3 in replacement: unknown substring /(?<!a{65535}a{5})x/I -Failed: error 187 at offset 16: lookbehind assertion is too long +Failed: error 187 at offset 0: lookbehind assertion is too long /(?<!a{65535})x/I Capturing subpattern count = 0 @@ -14726,11 +14900,11 @@ Subject length lower bound = 1 /(?=a\K)/replace=z BaCaD Failed: error -60: match with end before start is not supported - + /(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/ Failed: error 148 at offset 36: subpattern name is too long (maximum 32 characters) - -/(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/ + +/(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/ # These two use zero-termination /abcd/max_pattern_length=3 @@ -14744,7 +14918,7 @@ Failed: error 188 at offset 0: pattern string is longer than the limit set by th /abcdef/hex,max_pattern_length=3 -# These two patterns used to take a long time to compile +# These patterns used to take a long time to compile "(.*) ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2)) @@ -14767,21 +14941,21 @@ May match empty string Options: extended Subject length lower bound = 0 -# When (?| is used and groups of the same number may be different, -# we have to rely on a count to catch overly complicated patterns. - "(?|()|())(.*) ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2)) ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2)) ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI -Failed: error 186 at offset 148: regular expression is too complicated +Capturing subpattern count = 13 +May match empty string +Options: extended +Subject length lower bound = 0 "(?|()|())(?<=a() ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2)) ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2)) ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2)) a)"xI -Failed: error 186 at offset 154: regular expression is too complicated +Failed: error 135 at offset 9: lookbehind is too complicated # Test the use of malloc for caching group information when there are more # groups than fit into the on-stack workspace. @@ -14950,11 +15124,11 @@ Subject length lower bound = 0 /(A*)\E+/B,auto_callout ------------------------------------------------------------------ Bra - Callout 255 0 7 + Callout 255 0 1 SCBra 1 Callout 255 1 2 A* - Callout 255 3 0 + Callout 255 3 4 KetRmax Callout 255 7 0 Ket @@ -14964,10 +15138,10 @@ Subject length lower bound = 0 /()\Q\E*]/B,auto_callout ------------------------------------------------------------------ Bra - Callout 255 0 7 + Callout 255 0 1 Brazero SCBra 1 - Callout 255 1 0 + Callout 255 1 6 KetRmax Callout 255 7 1 ] @@ -14977,10 +15151,10 @@ Subject length lower bound = 0 ------------------------------------------------------------------ a[bc]d --->a[bc]d - +0 ^ ()\Q\E* - +1 ^ ) + +0 ^ ( + +1 ^ )\Q\E* +7 ^ ] - +8 ^^ + +8 ^^ End of pattern 0: ] 1: @@ -15077,12 +15251,12 @@ Subject length lower bound = 0 (?-x):?/extended /(8(*:6^\x09x\xa6l\)6!|\xd0:[^:|)\x09d\Z\d{85*m(?'(?<1!)*\W[*\xff]!!h\w]*\xbe;/alt_bsux,alt_verbnames,allow_empty_class,dollar_endonly,extended,multiline,never_utf,no_dotstar_anchor,no_start_optimize -Failed: error 124 at offset 49: letter or underscore expected after (?< or (?' +Failed: error 162 at offset 49: subpattern name expected /a|(b)c/replace=>$1<,substitute_unset_empty cat 1: c><t - xbcom + xbcom 1: x>b<om /a|(b)c/ @@ -15104,23 +15278,23 @@ Failed: error -49 at offset 9 in replacement: unknown substring /a|(?'X'b)c/replace=>$X<,substitute_unset_empty cat 1: c><t - xbcom + xbcom 1: x>b<om /a|(?'X'b)c/replace=>$Y<,substitute_unset_empty cat Failed: error -49 at offset 3 in replacement: unknown substring - cat\=substitute_unknown_unset + cat\=substitute_unknown_unset 1: c><t - cat\=substitute_unknown_unset,-substitute_unset_empty + cat\=substitute_unknown_unset,-substitute_unset_empty Failed: error -55 at offset 3 in replacement: requested value is not set /a|(b)c/replace=>$2<,substitute_unset_empty cat Failed: error -49 at offset 3 in replacement: unknown substring - cat\=substitute_unknown_unset + cat\=substitute_unknown_unset 1: c><t - cat\=substitute_unknown_unset,-substitute_unset_empty + cat\=substitute_unknown_unset,-substitute_unset_empty Failed: error -55 at offset 3 in replacement: requested value is not set /()()()/use_offset_limit @@ -15130,13 +15304,13 @@ Failed: error -55 at offset 3 in replacement: requested value is not set ** Invalid value in 'callout_fail=11000000000' \=callout_fail=1:11000000000 ** Invalid value in 'callout_fail=1:11000000000' - \=callout_data=11000000000 + \=callout_data=11000000000 ** Invalid value in 'callout_data=11000000000' - \=callout_data=-11000000000 + \=callout_data=-11000000000 ** Invalid value in 'callout_data=-11000000000' - \=offset_limit=1100000000000000000000 + \=offset_limit=1100000000000000000000 ** Invalid value in 'offset_limit=1100000000000000000000' - \=copy=11000000000 + \=copy=11000000000 ** Invalid value in 'copy=11000000000' /(*MARK:A\x00b)/mark @@ -15160,13 +15334,13 @@ MK: A\x00b MK: A\x00b /efg/hex -** Unexpected non-hex-digit 'g' in hex pattern: quote missing? +** Unexpected non-hex-digit 'g' at offset 2 in hex pattern: quote missing? /eff/hex ** Odd number of digits in hex pattern /effg/hex -** Unexpected non-hex-digit 'g' in hex pattern: quote missing? +** Unexpected non-hex-digit 'g' at offset 3 in hex pattern: quote missing? /(?J)(?'a'))(?'a')/ Failed: error 122 at offset 10: unmatched closing parenthesis @@ -15195,12 +15369,1219 @@ No match /\[AB]{6000000000000000000000}/expand ** Pattern repeat count too large -# End of testinput2 -Error -63: PCRE2_ERROR_BADDATA (unknown error number) +# Hex uses pattern length, not zero-terminated. This tests for overrunning +# the given length of a pattern. + +/'(*U'/hex +Failed: error 160 at offset 3: (*VERB) not recognized or malformed + +/'(*'/hex +Failed: error 109 at offset 1: quantifier does not follow a repeatable item + +/'('/hex +Failed: error 114 at offset 1: missing closing parenthesis + +//hex + +# These tests are here because Perl never allows a back reference in a +# lookbehind. PCRE2 supports some limited cases. + +/([ab])...(?<=\1)z/ + a11az + 0: a11az + 1: a + b11bz + 0: b11bz + 1: b +\= Expect no match + b11az +No match + +/(?|([ab]))...(?<=\1)z/ +Failed: error 125 at offset 13: lookbehind assertion is not fixed length + +/([ab])(\1)...(?<=\2)z/ + aa11az + 0: aa11az + 1: a + 2: a + +/(a\2)(b\1)(?<=\2)/ +Failed: error 125 at offset 10: lookbehind assertion is not fixed length + +/(?<A>[ab])...(?<=\k'A')z/ + a11az + 0: a11az + 1: a + b11bz + 0: b11bz + 1: b +\= Expect no match + b11az +No match + +/(?<A>[ab])...(?<=\k'A')(?<A>)z/dupnames +Failed: error 125 at offset 13: lookbehind assertion is not fixed length + +# Perl does not support \g+n + +/((\g+1X)?([ab]))+/ + aaXbbXa + 0: aaXbbXa + 1: bXa + 2: bX + 3: a + +/ab(?C1)c/auto_callout + abc +--->abc + +0 ^ a + +1 ^^ b + 1 ^ ^ c + +8 ^ ^ End of pattern + 0: abc + +/'ab(?C1)c'/hex,auto_callout + abc +--->abc + +0 ^ a + +1 ^^ b + 1 ^ ^ c + +8 ^ ^ End of pattern + 0: abc + +# Perl accepts these, but gives a warning. We can't warn, so give an error. + +/[a-[:digit:]]+/ +Failed: error 150 at offset 4: invalid range in character class + a-a9-a + +/[A-[:digit:]]+/ +Failed: error 150 at offset 4: invalid range in character class + A-A9-A + +/[a-\d]+/ +Failed: error 150 at offset 5: invalid range in character class + a-a9-a + +/(?<RA>abc)(?(R)xyz)/B +------------------------------------------------------------------ + Bra + CBra 1 + abc + Ket + Cond + Cond recurse any + xyz + Ket + Ket + End +------------------------------------------------------------------ + +/(?<R>abc)(?(R)xyz)/B +------------------------------------------------------------------ + Bra + CBra 1 + abc + Ket + Cond + 1 Cond ref + xyz + Ket + Ket + End +------------------------------------------------------------------ + +/(?=.*[A-Z])/I +Capturing subpattern count = 0 +May match empty string +Subject length lower bound = 0 + +/()(?<=(?0))/ +Failed: error 125 at offset 2: lookbehind assertion is not fixed length + +/(?<!|!(?<!))/ + +/(?<!|!|!||||||(?<!)||(?<!)!|!||(?<!)!|!(?<!)!|!|!|!||||!!|<!)!|!||||!|/ + +/{2,2{2,2/use_length + +/.>*?\g'0/use_length +Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number + +/.>*?\g'0/ +Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number + +/{„Í„ÍÍ„Í{'{22{2{{2{'{22{{22{2{'{22{2{{2{{222{{2{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{222{2Ä„Í„ÍÍ„Í{'{22{2{{2{'{22{{11{2{'{22{2{{2{{'{22{2{{2{'{22{{22{1{'{22{2{{2{{222{{2{'{22{2{22{2{'{/auto_callout + +// +\=get=i00000000000000000000000000000000 +** Group name in 'get' is too long +\=get=i2345678901234567890123456789012,get=i1245678901234567890123456789012 +** Too many characters in named 'get' modifiers + +"(?(?C))" +Failed: error 128 at offset 6: assertion expected after (?( or (?(?C) + +/(?(?(?(?(?(?))))))/ +Failed: error 128 at offset 2: assertion expected after (?( or (?(?C) + +/(?<=(?1))((?s))/anchored + +/(*:ab)*/ +Failed: error 109 at offset 6: quantifier does not follow a repeatable item + +%(*:(:(svvvvvvvvvv:]*[ Z!*;[]*[^[]*!^[+.+{{2,7}' _\\\\\\\\\\\\\)?.:.. *w////\\\Q\\\\\\\\\\\\\\\T\\\\\+/?/////'+\\\EEE?/////'+/*+/[^K]?]//(w)%never_backslash_c,alt_verbnames,auto_callout + +/./newline=crlf + \=ph +No match + +/(\x0e00\000000\xc)/replace=\P,substitute_extended + \x0e00\000000\xc +Failed: error -57 at offset 2 in replacement: bad escape sequence in replacement string + +//replace=0 + \=offset=7 +Failed: error -33: bad offset value + +".+\QX\E+"B,no_auto_possess +------------------------------------------------------------------ + Bra + Any+ + X+ + Ket + End +------------------------------------------------------------------ + +".+\QX\E+"B,auto_callout,no_auto_possess +------------------------------------------------------------------ + Bra + Callout 255 0 4 + Any+ + Callout 255 4 4 + X+ + Callout 255 8 0 + Ket + End +------------------------------------------------------------------ + +# This one is here because Perl gives an 'unmatched )' error which goes away +# if one of the \) sequences is removed - which is weird. PCRE finds it too +# complicated to find a minimum matching length. + +"()X|((((((((()))))))((((())))))\2())((((((\2\2)))\2)(\22((((\2\2)2))\2)))(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z+:)Z|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z((Z*(\2(Z\':))\0)i|||||||||||||||loZ\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0nte!rnal errpr\2\\21r(2\ZZZ)+:)Z!|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZernZal ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \))\ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)))\2))))((((((\2\2))))))"I +Capturing subpattern count = 108 +Max back reference = 22 +Contains explicit CR or LF match +Subject length lower bound = 1 + +# This checks that new code for handling groups that may match an empty string +# works on a very large number of alternatives. This pattern used to provoke a +# complaint that it was too complicated. + +/(?:\[A|B|C|D|E|F|G|H|I|J|]{200}Z)/expand + +# This one used to compile rubbish instead of a compile error, and then +# behave unpredictably at match time. + +/.+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X/ +Failed: error 128 at offset 63: assertion expected after (?( or (?(?C) + .+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X + +/[:[:alnum:]-[[a:lnum:]+/ +Failed: error 150 at offset 11: invalid range in character class + +/((?(?C'')\QX\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/ +Failed: error 128 at offset 11: assertion expected after (?( or (?(?C) + +/((?(?C'')\Q\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/ + +/abcd/auto_callout + abcd\=callout_error=255:2 +--->abcd + +0 ^ a + +1 ^^ b +Failed: error -37: callout error code + +/()(\g+65534)/ +Failed: error 161 at offset 11: group number is too big + +/()(\g+65533)/ +Failed: error 115 at offset 10: reference to non-existent subpattern + +/Á\x00\x00\x00š(\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\x00k\d+\x00‎\x00\x00\x00\x00\x00\2*\x00\x00\1*.){36}int^\x00\x00ÿÿ\x00š(\1{50779}?)J\w2/I +Capturing subpattern count = 2 +Max back reference = 2 +First code unit = \xc1 +Last code unit = '2' +Subject length lower bound = 65535 + +/(a)(b)\2\1\1\1\1/I +Capturing subpattern count = 2 +Max back reference = 2 +First code unit = 'a' +Last code unit = 'b' +Subject length lower bound = 7 + +/(?<a>a)(?<b>b)\g{b}\g{a}\g{a}\g{a}\g{a}(?<a>xx)(?<b>zz)/I,dupnames +Capturing subpattern count = 4 +Max back reference = 4 +Named capturing subpatterns: + a 1 + a 3 + b 2 + b 4 +Options: dupnames +First code unit = 'a' +Last code unit = 'z' +Subject length lower bound = 11 + +// + \=ovector=7777777777 +** Invalid value in 'ovector=7777777777' + +# This is here because Perl matches, even though a COMMIT is encountered +# outside of the recursion. + +/(?1)(A(*COMMIT)|B)D/ + BAXBAD +No match + +"(?1){2}(a)"B +------------------------------------------------------------------ + Bra + Recurse + Recurse + CBra 1 + a + Ket + Ket + End +------------------------------------------------------------------ + +"(?1){2,4}(a)"B +------------------------------------------------------------------ + Bra + Recurse + Recurse + Brazero + Bra + Bra + Recurse + Ket + Brazero + Bra + Recurse + Ket + Ket + CBra 1 + a + Ket + Ket + End +------------------------------------------------------------------ + +# This test differs from Perl for the first subject. Perl ends up with +# $1 set to 'B'; PCRE2 has it unset (which I think is right). + +/^(?: +(?:A| (?:B|B(*ACCEPT)) (?<=(.)) D) +(Z) +)+$/x + AZB + 0: AZB + 1: <unset> + 2: Z + AZBDZ + 0: AZBDZ + 1: B + 2: Z + +# The first of these, when run by Perl, gives the mark 'aa', which is wrong. + +'(?>a(*:aa))b|ac' mark + ac + 0: ac + +'(?:a(*:aa))b|ac' mark + ac + 0: ac + +/(R?){65}/ + (R?){65} + 0: + 1: + +/\[(a)]{60}/expand + aaaa +No match + +/(?<!\1((?U)1((?U))))(*F)/never_backslash_c,alt_bsux,anchored,extended + +/\g{3/ +Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number + +/(a(?C1)(b)(c)d)+/ + abcdabcd\=callout_capture +Callout 1: last capture = 0 +--->abcdabcd + ^^ ( +Callout 1: last capture = 1 + 1: abcd + 2: b + 3: c +--->abcdabcd + ^ ^ ( + 0: abcdabcd + 1: abcd + 2: b + 3: c + +# Perl matches this one, but PCRE does not because (*ACCEPT) clears out any +# pending backtracks in the recursion. + +/^ (?(DEFINE) (..(*ACCEPT)|...) ) (?1)$/x +\= Expect no match + abc +No match + +# Perl gives no match for this one + +/(a(*MARK:m)(*ACCEPT)){0}(?1)/mark + abc + 0: a +MK: m + +/abc/endanchored + xyzabc + 0: abc +\= Expect no match + xyzabcdef +No match +\= Expect error + xyzabc\=ph +Failed: error -34: bad option value + +/abc/ + xyzabc\=endanchored + 0: abc +\= Expect no match + xyzabcdef\=endanchored +No match +\= Expect error + xyzabc\=ps,endanchored +Failed: error -34: bad option value + +/abc(*ACCEPT)d/endanchored + xyzabc + 0: abc +\= Expect no match + xyzabcdef +No match + +/abc|bcd/endanchored + xyzabcd + 0: bcd +\= Expect no match + xyzabcdef +No match + +/a(*ACCEPT)x|aa/endanchored + aaa + 0: a + +# Check auto-anchoring when there is a group that is never obeyed at +# the start of a branch. + +/(?(DEFINE)(a))^bc/I +Capturing subpattern count = 1 +Compile options: <none> +Overall options: anchored +First code unit = 'b' +Subject length lower bound = 2 + +/(a){0}.*bc/sI +Capturing subpattern count = 1 +Compile options: dotall +Overall options: anchored dotall +Last code unit = 'c' +Subject length lower bound = 2 + +# This should be anchored, as the condition is always false and there is +# no alternative branch. + +/(?(VERSION>=999)yes)^bc/I +Capturing subpattern count = 0 +Compile options: <none> +Overall options: anchored +Subject length lower bound = 2 + +# This should not be anchored. + +/(?(VERSION>=999)yes|no)^bc/I +Capturing subpattern count = 0 +Last code unit = 'c' +Subject length lower bound = 4 + +/(*LIMIT_HEAP=0)xxx/I +Capturing subpattern count = 0 +Heap limit = 0 +First code unit = 'x' +Last code unit = 'x' +Subject length lower bound = 3 + +/\d{0,3}(*:abc)(?C1)xxx/callout_info +Callout 1 x + +# ---------------------------------------------------------------------- + +# These are a whole pile of tests that touch lines of code that are not +# used by any other tests (at least when these were created). + +/^a+?x/i,no_start_optimize,no_auto_possess +\= Expect no match + aaa +No match + +/^[^a]{3,}?x/i,no_start_optimize,no_auto_possess +\= Expect no match + bbb +No match + cc +No match + +/^X\S/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + +/^X\W/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + +/^X\H/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + +/^X\h/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + +/^X\V/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + +/^X\v/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + +/^X\h/no_start_optimize,no_auto_possess +\= Expect no match + XY +No match + +/^X\V/no_start_optimize,no_auto_possess +\= Expect no match + X\n +No match + +/^X\v/no_start_optimize,no_auto_possess +\= Expect no match + XX +No match + +/^X.+?/s,no_start_optimize,no_auto_possess +\= Expect no match + X +No match + +/^X\R+?/no_start_optimize,no_auto_possess +\= Expect no match + XX +No match + +/^X\H+?/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + +/^X\h+?/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + +/^X\V+?/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + X\n +No match + +/^X\D+?/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + X9 +No match + +/^X\S+?/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + X\n +No match + +/^X\W+?/no_start_optimize,no_auto_possess +\= Expect no match + X +No match + XX +No match + +/^X.+?Z/no_start_optimize,no_auto_possess +\= Expect no match + XY\n +No match + +/(*CRLF)^X.+?Z/no_start_optimize,no_auto_possess +\= Expect no match + XY\r\=ps +Partial match: XY\x0d + +/^X\R+?Z/no_start_optimize,no_auto_possess +\= Expect no match + X\nX +No match + X\n\r\n +No match + X\n\rY +No match + X\n\nY +No match + X\n\x{0c}Y +No match + +/(*BSR_ANYCRLF)^X\R+?Z/no_start_optimize,no_auto_possess +\= Expect no match + X\nX +No match + X\n\r\n +No match + X\n\rY +No match + X\n\nY +No match + X\n\x{0c}Y +No match + +/^X\H+?Z/no_start_optimize,no_auto_possess +\= Expect no match + XY\t +No match + XYY +No match + +/^X\h+?Z/no_start_optimize,no_auto_possess +\= Expect no match + X\t\t +No match + X\tY +No match + +/^X\V+?Z/no_start_optimize,no_auto_possess +\= Expect no match + XY\n +No match + XYY +No match + +/^X\v+?Z/no_start_optimize,no_auto_possess +\= Expect no match + X\n\n +No match + X\nY +No match + +/^X\D+?Z/no_start_optimize,no_auto_possess +\= Expect no match + XY9 +No match + XYY +No match + +/^X\d+?Z/no_start_optimize,no_auto_possess +\= Expect no match + X99 +No match + X9Y +No match + +/^X\S+?Z/no_start_optimize,no_auto_possess +\= Expect no match + XY\n +No match + XYY +No match + +/^X\s+?Z/no_start_optimize,no_auto_possess +\= Expect no match + X\n\n +No match + X\nY +No match + +/^X\W+?Z/no_start_optimize,no_auto_possess +\= Expect no match + X.A +No match + X++ +No match + +/^X\w+?Z/no_start_optimize,no_auto_possess +\= Expect no match + Xa. +No match + Xaa +No match + +/^X.{1,3}Z/s,no_start_optimize,no_auto_possess +\= Expect no match + Xa.bd +No match + +/^X\h+Z/no_start_optimize,no_auto_possess +\= Expect no match + X\t\t +No match + X\tY +No match + +/^X\V+Z/no_start_optimize,no_auto_possess +\= Expect no match + XY\n +No match + XYY +No match + +/^(X(*THEN)Y|AB){0}(?1)/ + ABX + 0: AB +\= Expect no match + XAB +No match + +/^(?!A(?C1)B)C/ + ABC\=callout_error=1,no_jit +No match + +/^(?!A(?C1)B)C/no_start_optimize + ABC\=callout_error=1 +--->ABC + 1 ^^ B +Failed: error -37: callout error code + +/^(?(?!A(?C1)B)C)/ + ABC\=callout_error=1 +--->ABC + 1 ^^ B +Failed: error -37: callout error code + +# ---------------------------------------------------------------------- + +/[a b c]/BxxI +------------------------------------------------------------------ + Bra + [a-c] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: extended_more +Starting code units: a b c +Subject length lower bound = 1 + +/[a b c]/BxxxI +------------------------------------------------------------------ + Bra + [a-c] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: extended extended_more +Starting code units: a b c +Subject length lower bound = 1 + +/[a b c]/B,extended_more +------------------------------------------------------------------ + Bra + [a-c] + Ket + End +------------------------------------------------------------------ + +/[ a b c ]/B,extended_more +------------------------------------------------------------------ + Bra + [a-c] + Ket + End +------------------------------------------------------------------ + +/[a b](?xx: [ 12 ] (?-xx:[ 34 ]) )y z/B +------------------------------------------------------------------ + Bra + [ ab] + Bra + [12] + Bra + [ 34] + Ket + Ket + y z + Ket + End +------------------------------------------------------------------ + +# Unsetting /x also unsets /xx + +/[a b](?xx: [ 12 ] (?-x:[ 34 ]) )y z/B +------------------------------------------------------------------ + Bra + [ ab] + Bra + [12] + Bra + [ 34] + Ket + Ket + y z + Ket + End +------------------------------------------------------------------ + +/(a)(?-n:(b))(c)/nB +------------------------------------------------------------------ + Bra + Bra + a + Ket + Bra + CBra 1 + b + Ket + Ket + Bra + c + Ket + Ket + End +------------------------------------------------------------------ + +# ---------------------------------------------------------------------- +# These test the dangerous PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL option. + +/\j\x{z}\o{82}\L\uabcd\u\U\g{\g/B,\bad_escape_is_literal +** Unrecognized modifier '\' in '\bad_escape_is_literal' + +/\N{\c/IB,bad_escape_is_literal +------------------------------------------------------------------ + Bra + N{c + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Extra options: bad_escape_is_literal +First code unit = 'N' +Last code unit = 'c' +Subject length lower bound = 3 + +/[\j\x{z}\o\gA-\Nb-\g]/B,bad_escape_is_literal +------------------------------------------------------------------ + Bra + [A-Nb-gjoxz{}] + Ket + End +------------------------------------------------------------------ + +/[Q-\N]/B,bad_escape_is_literal +Failed: error 108 at offset 4: range out of order in character class + +# ---------------------------------------------------------------------- + +/a\b(c/literal + a\\b(c + 0: a\b(c + +/a\b(c/literal,caseless + a\\b(c + 0: a\b(c + a\\B(c + 0: a\B(c + +/a\b(c/literal,firstline + XYYa\\b(c + 0: a\b(c +\= Expect no match + X\na\\b(c +No match + +/a\b?c/literal,use_offset_limit + XXXXa\\b?c\=offset_limit=4 + 0: a\b?c +\= Expect no match + XXXXa\\b?c\=offset_limit=3 +No match + +/a\b(c/literal,anchored,endanchored + a\\b(c + 0: a\b(c +\= Expect no match + Xa\\b(c +No match + a\\b(cX +No match + Xa\\b(cX +No match + +//literal,extended +Failed: error 192 at offset 0: invalid option bits with PCRE2_LITERAL + +/a\b(c/literal,auto_callout,no_start_optimize + XXXXa\\b(c +--->XXXXa\b(c + +0 ^ a + +0 ^ a + +0 ^ a + +0 ^ a + +0 ^ a + +1 ^^ \ + +2 ^ ^ b + +3 ^ ^ ( + +4 ^ ^ c + +5 ^ ^ End of pattern + 0: a\b(c + +/a\b(c/literal,auto_callout + XXXXa\\b(c +--->XXXXa\b(c + +0 ^ a + +1 ^^ \ + +2 ^ ^ b + +3 ^ ^ ( + +4 ^ ^ c + +5 ^ ^ End of pattern + 0: a\b(c + +/(*CR)abc/literal + (*CR)abc + 0: (*CR)abc + +/cat|dog/I,match_word +Capturing subpattern count = 0 +Max lookbehind = 1 +Extra options: match_word +Starting code units: c d +Subject length lower bound = 3 + the cat sat + 0: cat +\= Expect no match + caterpillar +No match + snowcat +No match + syndicate +No match + +/(cat)|dog/I,match_line,literal +Capturing subpattern count = 0 +Compile options: literal +Overall options: anchored literal +Extra options: match_line +First code unit = '(' +Subject length lower bound = 9 + (cat)|dog + 0: (cat)|dog +\= Expect no match + the cat sat +No match + caterpillar +No match + snowcat +No match + syndicate +No match + +/a whole line/match_line,multiline + Rhubarb \na whole line\n custard + 0: a whole line +\= Expect no match + Not a whole line +No match + +# Perl gets this wrong, failing to capture 'b' in group 1. + +/^(b+|a){1,2}?bc/ + bbc + 0: bbc + 1: b + +# And again here, for the "babc" subject string. + +/^(b*|ba){1,2}?bc/ + babc + 0: babc + 1: ba + bbabc + 0: bbabc + 1: ba + bababc + 0: bababc + 1: ba +\= Expect no match + bababbc +No match + babababc +No match + +/[[:digit:]-a]/ +Failed: error 150 at offset 10: invalid range in character class + +/[[:digit:]-[:print:]]/ +Failed: error 150 at offset 10: invalid range in character class + +/[\d-a]/ +Failed: error 150 at offset 3: invalid range in character class + +/[\H-z]/ +Failed: error 150 at offset 3: invalid range in character class + +/[\d-[:print:]]/ +Failed: error 150 at offset 3: invalid range in character class + +# Perl gets the second of these wrong, giving no match. + +"(?<=(a))\1?b"I +Capturing subpattern count = 1 +Max back reference = 1 +Max lookbehind = 1 +Last code unit = 'b' +Subject length lower bound = 1 + ab + 0: b + 1: a + aaab + 0: ab + 1: a + +"(?=(a))\1?b"I +Capturing subpattern count = 1 +Max back reference = 1 +First code unit = 'a' +Last code unit = 'b' +Subject length lower bound = 1 + ab + 0: ab + 1: a + aaab + 0: ab + 1: a + +# JIT does not support callout_extra + +/(*NO_JIT)(a+)b/auto_callout,no_start_optimize,no_auto_possess +\= Expect no match + aac\=callout_extra +New match attempt +--->aac + +9 ^ ( ++10 ^ a+ ++12 ^ ^ ) ++13 ^ ^ b +Backtrack +--->aac ++12 ^^ ) ++13 ^^ b +Backtrack +No other matching paths +New match attempt +--->aac + +9 ^ ( ++10 ^ a+ ++12 ^^ ) ++13 ^^ b +Backtrack +No other matching paths +New match attempt +--->aac + +9 ^ ( ++10 ^ a+ +Backtrack +No other matching paths +New match attempt +--->aac + +9 ^ ( ++10 ^ a+ +No match + +/(*NO_JIT)a+(?C'XXX')b/no_start_optimize,no_auto_possess +\= Expect no match + aac\=callout_extra +New match attempt +Callout (15): 'XXX' +--->aac + ^ ^ b +Backtrack +Callout (15): 'XXX' +--->aac + ^^ b +Backtrack +No other matching paths +New match attempt +Callout (15): 'XXX' +--->aac + ^^ b +No match + +/\n/firstline + xyz\nabc + 0: \x0a + +/\nabc/firstline + xyz\nabc + 0: \x0aabc + +/\x{0a}abc/firstline,newline=crlf +\= Expect no match + xyz\r\nabc +No match + +/[abc]/firstline +\= Expect no match + \na +No match + +# These tests are matched in test 1 as they are Perl compatible. Here we are +# looking at what does and does not get auto-possessified. + +/(?(DEFINE)(?<optional_a>a?))^(?&optional_a)a$/B +------------------------------------------------------------------ + Bra + Cond + Cond false + CBra 1 + a? + Ket + Ket + ^ + Recurse + a + $ + Ket + End +------------------------------------------------------------------ + +/(?(DEFINE)(?<optional_a>a?)X)^(?&optional_a)a$/B +------------------------------------------------------------------ + Bra + Cond + Cond false + CBra 1 + a? + Ket + X + Ket + ^ + Recurse + a + $ + Ket + End +------------------------------------------------------------------ + +/^(a?)b(?1)a/B +------------------------------------------------------------------ + Bra + ^ + CBra 1 + a? + Ket + b + Recurse + a + Ket + End +------------------------------------------------------------------ + +/^(a?)+b(?1)a/B +------------------------------------------------------------------ + Bra + ^ + SCBra 1 + a? + KetRmax + b + Recurse + a + Ket + End +------------------------------------------------------------------ + +/^(a?)++b(?1)a/B +------------------------------------------------------------------ + Bra + ^ + SCBraPos 1 + a? + KetRpos + b + Recurse + a + Ket + End +------------------------------------------------------------------ + +/^(a?)+b/B +------------------------------------------------------------------ + Bra + ^ + SCBra 1 + a? + KetRmax + b + Ket + End +------------------------------------------------------------------ + +/(?=a+)a(a+)++b/B +------------------------------------------------------------------ + Bra + Assert + a++ + Ket + a + CBraPos 1 + a++ + KetRpos + b + Ket + End +------------------------------------------------------------------ + +# End of testinput2 +Error -65: PCRE2_ERROR_BADDATA (unknown error number) Error -62: bad serialized data Error -2: partial match Error -1: no match Error 0: PCRE2_ERROR_BADDATA (unknown error number) Error 100: no error -Error 188: pattern string is longer than the limit set by the application -Error 189: PCRE2_ERROR_BADDATA (unknown error number) +Error 101: \ at end of pattern +Error 191: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowed in UTF-16 mode +Error 200: PCRE2_ERROR_BADDATA (unknown error number) |