blob: 7178410cfe8c22aebbfee508f56d9d4715e10e41 [file] [log] [blame]
# 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
# bug.
# NOTE: This is a non-UTF set of tests. When UTF support is needed, use
# test 5.
#forbid_utf
#newline_default lf any anycrlf
# Test binary zeroes in the pattern
# /a\0B/ where 0 is a binary zero
/61 5c 00 62/B,hex
------------------------------------------------------------------
Bra
a\x00b
Ket
End
------------------------------------------------------------------
a\x{0}b
0: a\x00b
# /a0b/ where 0 is a binary zero
/61 00 62/B,hex
------------------------------------------------------------------
Bra
a\x00b
Ket
End
------------------------------------------------------------------
a\x{0}b
0: a\x00b
# /(?#B0C)DE/ where 0 is a binary zero
/28 3f 23 42 00 43 29 44 45/B,hex
------------------------------------------------------------------
Bra
DE
Ket
End
------------------------------------------------------------------
DE
0: DE
/(a)b|/I
Capturing subpattern count = 1
May match empty string
Subject length lower bound = 0
/abc/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
abc
0: abc
defabc
0: abc
abc\=anchored
0: abc
\= Expect no match
defabc\=anchored
No match
ABC
No match
/^abc/I
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
abc
0: abc
abc\=anchored
0: abc
\= Expect no match
defabc
No match
defabc\=anchored
No match
/a+bc/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
/a*bc/I
Capturing subpattern count = 0
Starting code units: a b
Last code unit = 'c'
Subject length lower bound = 2
/a{3}bc/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 5
/(abc|a+z)/I
Capturing subpattern count = 1
First code unit = 'a'
Subject length lower bound = 2
/^abc$/I
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
abc
0: abc
\= Expect no match
def\nabc
No match
/ab\idef/
Failed: error 103 at offset 3: unrecognized character follows \
/(?X)ab\idef/
Failed: error 111 at offset 2: unrecognized character after (? or (?-
/x{5,4}/
Failed: error 104 at offset 5: numbers out of order in {} quantifier
/z{65536}/
Failed: error 105 at offset 7: number too big in {} quantifier
/[abcd/
Failed: error 106 at offset 5: missing terminating ] for character class
/[\B]/B
Failed: error 107 at offset 2: invalid escape sequence in character class
/[\R]/B
Failed: error 107 at offset 2: invalid escape sequence in character class
/[\X]/B
Failed: error 107 at offset 2: invalid escape sequence in character class
/[z-a]/
Failed: error 108 at offset 3: range out of order in character class
/^*/
Failed: error 109 at offset 1: quantifier does not follow a repeatable item
/(abc/
Failed: error 114 at offset 4: missing closing parenthesis
/(?# abc/
Failed: error 118 at offset 7: missing ) after (?# comment
/(?z)abc/
Failed: error 111 at offset 2: unrecognized character after (? or (?-
/.*b/I
Capturing subpattern count = 0
First code unit at start or follows newline
Last code unit = 'b'
Subject length lower bound = 1
/.*?b/I
Capturing subpattern count = 0
First code unit at start or follows newline
Last code unit = 'b'
Subject length lower bound = 1
/cat|dog|elephant/I
Capturing subpattern count = 0
Starting code units: c d e
Subject length lower bound = 3
this sentence eventually mentions a cat
0: cat
this sentences rambles on and on for a while and then reaches elephant
0: elephant
/cat|dog|elephant/I
Capturing subpattern count = 0
Starting code units: c d e
Subject length lower bound = 3
this sentence eventually mentions a cat
0: cat
this sentences rambles on and on for a while and then reaches elephant
0: elephant
/cat|dog|elephant/Ii
Capturing subpattern count = 0
Options: caseless
Starting code units: C D E c d e
Subject length lower bound = 3
this sentence eventually mentions a CAT cat
0: CAT
this sentences rambles on and on for a while to elephant ElePhant
0: elephant
/a|[bcd]/I
Capturing subpattern count = 0
Starting code units: a b c d
Subject length lower bound = 1
/(a|[^\dZ])/I
Capturing subpattern count = 1
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 ! " # $ % & ' ( ) * + , - . / : ; < = >
? @ 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 [ \ ] ^ _ ` 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
/(a|b)*[\s]/I
Capturing subpattern count = 1
Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b
Subject length lower bound = 1
/(ab\2)/
Failed: error 115 at offset 4: reference to non-existent subpattern
/{4,5}abc/
Failed: error 109 at offset 4: quantifier does not follow a repeatable item
/(a)(b)(c)\2/I
Capturing subpattern count = 3
Max back reference = 2
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 4
abcb
0: abcb
1: a
2: b
3: c
abcb\=ovector=0
0: abcb
1: a
2: b
3: c
abcb\=ovector=1
Matched, but too many substrings
0: abcb
abcb\=ovector=2
Matched, but too many substrings
0: abcb
1: a
abcb\=ovector=3
Matched, but too many substrings
0: abcb
1: a
2: b
abcb\=ovector=4
0: abcb
1: a
2: b
3: c
/(a)bc|(a)(b)\2/I
Capturing subpattern count = 3
Max back reference = 2
First code unit = 'a'
Subject length lower bound = 3
abc
0: abc
1: a
abc\=ovector=0
0: abc
1: a
abc\=ovector=1
Matched, but too many substrings
0: abc
abc\=ovector=2
0: abc
1: a
aba
0: aba
1: <unset>
2: a
3: b
aba\=ovector=0
0: aba
1: <unset>
2: a
3: b
aba\=ovector=1
Matched, but too many substrings
0: aba
aba\=ovector=2
Matched, but too many substrings
0: aba
1: <unset>
aba\=ovector=3
Matched, but too many substrings
0: aba
1: <unset>
2: a
aba\=ovector=4
0: aba
1: <unset>
2: a
3: b
/abc$/I,dollar_endonly
Capturing subpattern count = 0
Options: dollar_endonly
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
abc
0: abc
\= Expect no match
abc\n
No match
abc\ndef
No match
/(a)(b)(c)(d)(e)\6/
Failed: error 115 at offset 16: reference to non-existent subpattern
/the quick brown fox/I
Capturing subpattern count = 0
First code unit = 't'
Last code unit = 'x'
Subject length lower bound = 19
the quick brown fox
0: the quick brown fox
this is a line with the quick brown fox
0: the quick brown fox
/the quick brown fox/I,anchored
Capturing subpattern count = 0
Options: anchored
Subject length lower bound = 19
the quick brown fox
0: the quick brown fox
\= Expect no match
this is a line with the quick brown fox
No match
/ab(?z)cd/
Failed: error 111 at offset 4: unrecognized character after (? or (?-
/^abc|def/I
Capturing subpattern count = 0
Subject length lower bound = 3
abcdef
0: abc
abcdef\=notbol
0: def
/.*((abc)$|(def))/I
Capturing subpattern count = 3
First code unit at start or follows newline
Subject length lower bound = 3
defabc
0: defabc
1: abc
2: abc
defabc\=noteol
0: def
1: def
2: <unset>
3: def
/)/
Failed: error 122 at offset 0: unmatched closing parenthesis
/a[]b/
Failed: error 106 at offset 4: missing terminating ] for character class
/[^aeiou ]{3,}/I
Capturing subpattern count = 0
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 ! " # $ % & ' ( ) * + , - . / 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 [
\ ] ^ _ ` b c d f g h j k l m n p q r s t 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 = 3
co-processors, and for
0: -pr
/<.*>/I
Capturing subpattern count = 0
First code unit = '<'
Last code unit = '>'
Subject length lower bound = 2
abc<def>ghi<klm>nop
0: <def>ghi<klm>
/<.*?>/I
Capturing subpattern count = 0
First code unit = '<'
Last code unit = '>'
Subject length lower bound = 2
abc<def>ghi<klm>nop
0: <def>
/<.*>/I,ungreedy
Capturing subpattern count = 0
Options: ungreedy
First code unit = '<'
Last code unit = '>'
Subject length lower bound = 2
abc<def>ghi<klm>nop
0: <def>
/(?U)<.*>/I
Capturing subpattern count = 0
First code unit = '<'
Last code unit = '>'
Subject length lower bound = 2
abc<def>ghi<klm>nop
0: <def>
/<.*?>/I,ungreedy
Capturing subpattern count = 0
Options: ungreedy
First code unit = '<'
Last code unit = '>'
Subject length lower bound = 2
abc<def>ghi<klm>nop
0: <def>ghi<klm>
/={3,}/I,ungreedy
Capturing subpattern count = 0
Options: ungreedy
First code unit = '='
Last code unit = '='
Subject length lower bound = 3
abc========def
0: ===
/(?U)={3,}?/I
Capturing subpattern count = 0
First code unit = '='
Last code unit = '='
Subject length lower bound = 3
abc========def
0: ========
/(?<!bar|cattle)foo/I
Capturing subpattern count = 0
Max lookbehind = 6
First code unit = 'f'
Last code unit = 'o'
Subject length lower bound = 3
foo
0: foo
catfoo
0: foo
\= Expect no match
the barfoo
No match
and cattlefoo
No match
/(?<=a+)b/
Failed: error 125 at offset 6: lookbehind assertion is not fixed length
/(?<=aaa|b{0,3})b/
Failed: error 125 at offset 14: 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
First code unit = 'a' (caseless)
Last code unit = 'c' (caseless)
Subject length lower bound = 3
/(a|(?m)a)/I
Capturing subpattern count = 1
First code unit = 'a'
Subject length lower bound = 1
/(?i)^1234/I
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 4
/(^b|(?i)^d)/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/(?s).*/I
Capturing subpattern count = 0
May match empty string
Compile options: <none>
Overall options: anchored
Subject length lower bound = 0
/[abcd]/I
Capturing subpattern count = 0
Starting code units: a b c d
Subject length lower bound = 1
/(?i)[abcd]/I
Capturing subpattern count = 0
Starting code units: A B C D a b c d
Subject length lower bound = 1
/(?m)[xy]|(b|c)/I
Capturing subpattern count = 1
Starting code units: b c x y
Subject length lower bound = 1
/(^a|^b)/Im
Capturing subpattern count = 1
Options: multiline
First code unit at start or follows newline
Subject length lower bound = 1
/(?i)(^a|^b)/Im
Capturing subpattern count = 1
Options: multiline
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
/(?(?=a)a|b|c)/
Failed: error 127 at offset 12: conditional group contains more than two branches
/(?(1a)/
Failed: error 126 at offset 4: malformed number or name after (?(
/(?(1a))/
Failed: error 126 at offset 4: malformed number or name after (?(
/(?(?i))/
Failed: error 128 at offset 3: assertion expected after (?( or (?(?C)
/(?(abc))/
Failed: error 115 at offset 7: reference to non-existent subpattern
/(?(?<ab))/
Failed: error 128 at offset 3: assertion expected after (?( or (?(?C)
/((?s)blah)\s+\1/I
Capturing subpattern count = 1
Max back reference = 1
First code unit = 'b'
Last code unit = 'h'
Subject length lower bound = 9
/((?i)blah)\s+\1/I
Capturing subpattern count = 1
Max back reference = 1
First code unit = 'b' (caseless)
Last code unit = 'h' (caseless)
Subject length lower bound = 9
/((?i)b)/IB
------------------------------------------------------------------
Bra
CBra 1
/i b
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
First code unit = 'b' (caseless)
Subject length lower bound = 1
/(a*b|(?i:c*(?-i)d))/I
Capturing subpattern count = 1
Starting code units: C a b c d
Subject length lower bound = 1
/a$/I
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 1
a
0: a
a\n
0: a
\= Expect no match
a\=noteol
No match
a\n\=noteol
No match
/a$/Im
Capturing subpattern count = 0
Options: multiline
First code unit = 'a'
Subject length lower bound = 1
a
0: a
a\n
0: a
a\n\=noteol
0: a
\= Expect no match
a\=noteol
No match
/\Aabc/Im
Capturing subpattern count = 0
Max lookbehind = 1
Compile options: multiline
Overall options: anchored multiline
Subject length lower bound = 3
/^abc/Im
Capturing subpattern count = 0
Options: multiline
First code unit at start or follows newline
Last code unit = 'c'
Subject length lower bound = 3
/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
Capturing subpattern count = 5
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
aaaaabbbbbcccccdef
0: aaaaabbbbbcccccdef
1: aaaaabbbbbcccccdef
2: aaaaa
3: b
4: bbbbccccc
5: def
/(?<=foo)[ab]/I
Capturing subpattern count = 0
Max lookbehind = 3
Starting code units: a b
Subject length lower bound = 1
/(?<!foo)(alpha|omega)/I
Capturing subpattern count = 1
Max lookbehind = 3
Starting code units: a o
Last code unit = 'a'
Subject length lower bound = 5
/(?!alphabet)[ab]/I
Capturing subpattern count = 0
Starting code units: a b
Subject length lower bound = 1
/(?<=foo\n)^bar/Im
Capturing subpattern count = 0
Max lookbehind = 4
Contains explicit CR or LF match
Options: multiline
Last code unit = 'r'
Subject length lower bound = 3
foo\nbarbar
0: bar
\= Expect no match
rhubarb
No match
barbell
No match
abc\nbarton
No match
/^(?<=foo\n)bar/Im
Capturing subpattern count = 0
Max lookbehind = 4
Contains explicit CR or LF match
Options: multiline
First code unit at start or follows newline
Last code unit = 'r'
Subject length lower bound = 3
foo\nbarbar
0: bar
\= Expect no match
rhubarb
No match
barbell
No match
abc\nbarton
No match
/(?>^abc)/Im
Capturing subpattern count = 0
Options: multiline
First code unit at start or follows newline
Last code unit = 'c'
Subject length lower bound = 3
abc
0: abc
def\nabc
0: abc
\= Expect no match
defabc
No match
/(?<=ab(c+)d)ef/
Failed: error 125 at offset 11: lookbehind assertion is not fixed length
/(?<=ab(?<=c+)d)ef/
Failed: error 125 at offset 12: lookbehind assertion is not fixed length
/(?<=ab(c|de)f)g/
Failed: error 125 at offset 13: lookbehind assertion is not fixed length
/The next three are in testinput2 because they have variable length branches/
/(?<=bullock|donkey)-cart/I
Capturing subpattern count = 0
Max lookbehind = 7
First code unit = '-'
Last code unit = 't'
Subject length lower bound = 5
the bullock-cart
0: -cart
a donkey-cart race
0: -cart
\= Expect no match
cart
No match
horse-and-cart
No match
/(?<=ab(?i)x|y|z)/I
Capturing subpattern count = 0
Max lookbehind = 3
May match empty string
Subject length lower bound = 0
/(?>.*)(?<=(abcd)|(xyz))/I
Capturing subpattern count = 2
Max lookbehind = 4
May match empty string
Subject length lower bound = 0
alphabetabcd
0: alphabetabcd
1: abcd
endingxyz
0: endingxyz
1: <unset>
2: xyz
/(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
Capturing subpattern count = 0
Max lookbehind = 4
First code unit = 'Z'
Last code unit = 'Z'
Subject length lower bound = 2
abxyZZ
0: ZZ
abXyZZ
0: ZZ
ZZZ
0: ZZ
zZZ
0: ZZ
bZZ
0: ZZ
BZZ
0: ZZ
\= Expect no match
ZZ
No match
abXYZZ
No match
zzz
No match
bzz
No match
/(?<!(foo)a)bar/I
Capturing subpattern count = 1
Max lookbehind = 4
First code unit = 'b'
Last code unit = 'r'
Subject length lower bound = 3
bar
0: bar
foobbar
0: bar
\= Expect no match
fooabar
No match
# This one is here because Perl behaves differently; see also the following.
/^(a\1?){4}$/I
Capturing subpattern count = 1
Max back reference = 1
Compile options: <none>
Overall options: anchored
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.
/^(xa|=?\1a){2}$/
xa=xaa
0: xa=xaa
1: =xaa
\= Expect no match
xa=xaaa
No match
/^(xa|=?\1a)+$/
xa=xaa
0: xa=xaa
1: =xaa
\= Expect no match
xa=xaaa
No match
# These are syntax tests from Perl 5.005
/a[b-a]/
Failed: error 108 at offset 4: range out of order in character class
/a[]b/
Failed: error 106 at offset 4: missing terminating ] for character class
/a[/
Failed: error 106 at offset 2: missing terminating ] for character class
/*a/
Failed: error 109 at offset 0: quantifier does not follow a repeatable item
/(*)b/
Failed: error 109 at offset 1: quantifier does not follow a repeatable item
/abc)/
Failed: error 122 at offset 3: unmatched closing parenthesis
/(abc/
Failed: error 114 at offset 4: missing closing parenthesis
/a**/
Failed: error 109 at offset 2: quantifier does not follow a repeatable item
/)(/
Failed: error 122 at offset 0: unmatched closing parenthesis
/\1/
Failed: error 115 at offset 1: reference to non-existent subpattern
/\2/
Failed: error 115 at offset 1: reference to non-existent subpattern
/(a)|\2/
Failed: error 115 at offset 5: reference to non-existent subpattern
/a[b-a]/Ii
Failed: error 108 at offset 4: range out of order in character class
/a[]b/Ii
Failed: error 106 at offset 4: missing terminating ] for character class
/a[/Ii
Failed: error 106 at offset 2: missing terminating ] for character class
/*a/Ii
Failed: error 109 at offset 0: quantifier does not follow a repeatable item
/(*)b/Ii
Failed: error 109 at offset 1: quantifier does not follow a repeatable item
/abc)/Ii
Failed: error 122 at offset 3: unmatched closing parenthesis
/(abc/Ii
Failed: error 114 at offset 4: missing closing parenthesis
/a**/Ii
Failed: error 109 at offset 2: quantifier does not follow a repeatable item
/)(/Ii
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 (?'
/a(?{)b/
Failed: error 111 at offset 3: unrecognized character after (? or (?-
/a(?{{})b/
Failed: error 111 at offset 3: unrecognized character after (? or (?-
/a(?{}})b/
Failed: error 111 at offset 3: unrecognized character after (? or (?-
/a(?{"{"})b/
Failed: error 111 at offset 3: unrecognized character after (? or (?-
/a(?{"{"}})b/
Failed: error 111 at offset 3: unrecognized character after (? or (?-
/(?(1?)a|b)/
Failed: error 126 at offset 4: malformed number or name after (?(
/[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
/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
/abc/\i
Failed: error 101 at offset 3: \ at end of pattern
/(a)bc(d)/I
Capturing subpattern count = 2
First code unit = 'a'
Last code unit = 'd'
Subject length lower bound = 4
abcd
0: abcd
1: a
2: d
abcd\=copy=2
0: abcd
1: a
2: d
2C d (1)
abcd\=copy=5
0: abcd
1: a
2: d
Copy substring 5 failed (-49): unknown substring
/(.{20})/I
Capturing subpattern count = 1
Subject length lower bound = 20
abcdefghijklmnopqrstuvwxyz
0: abcdefghijklmnopqrst
1: abcdefghijklmnopqrst
abcdefghijklmnopqrstuvwxyz\=copy=1
0: abcdefghijklmnopqrst
1: abcdefghijklmnopqrst
1C abcdefghijklmnopqrst (20)
abcdefghijklmnopqrstuvwxyz\=get=1
0: abcdefghijklmnopqrst
1: abcdefghijklmnopqrst
1G abcdefghijklmnopqrst (20)
/(.{15})/I
Capturing subpattern count = 1
Subject length lower bound = 15
abcdefghijklmnopqrstuvwxyz
0: abcdefghijklmno
1: abcdefghijklmno
abcdefghijklmnopqrstuvwxyz\=copy=1,get=1
0: abcdefghijklmno
1: abcdefghijklmno
1C abcdefghijklmno (15)
1G abcdefghijklmno (15)
/(.{16})/I
Capturing subpattern count = 1
Subject length lower bound = 16
abcdefghijklmnopqrstuvwxyz
0: abcdefghijklmnop
1: abcdefghijklmnop
abcdefghijklmnopqrstuvwxyz\=copy=1,get=1,getall
0: abcdefghijklmnop
1: abcdefghijklmnop
1C abcdefghijklmnop (16)
1G abcdefghijklmnop (16)
0L abcdefghijklmnop
1L abcdefghijklmnop
/^(a|(bc))de(f)/I
Capturing subpattern count = 3
Compile options: <none>
Overall options: anchored
Subject length lower bound = 4
adef\=get=1,get=2,get=3,get=4,getall
0: adef
1: a
2: <unset>
3: f
1G a (1)
Get substring 2 failed (-55): requested value is not set
3G f (1)
Get substring 4 failed (-49): unknown substring
0L adef
1L a
2L
3L f
bcdef\=get=1,get=2,get=3,get=4,getall
0: bcdef
1: bc
2: bc
3: f
1G bc (2)
2G bc (2)
3G f (1)
Get substring 4 failed (-49): unknown substring
0L bcdef
1L bc
2L bc
3L f
adefghijk\=copy=0
0: adef
1: a
2: <unset>
3: f
0C adef (4)
/^abc\00def/I
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 7
abc\00def\=copy=0,getall
0: abc\x00def
0C abc\x00def (7)
0L abc\x00def
/word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
)((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
)?)?)?)?)?)?)?)?)?otherword/I
Capturing subpattern count = 8
Contains explicit CR or LF match
First code unit = 'w'
Last code unit = 'd'
Subject length lower bound = 14
/.*X/IB
------------------------------------------------------------------
Bra
Any*
X
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit at start or follows newline
Last code unit = 'X'
Subject length lower bound = 1
/.*X/IBs
------------------------------------------------------------------
Bra
AllAny*
X
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: dotall
Overall options: anchored dotall
Last code unit = 'X'
Subject length lower bound = 1
/(.*X|^B)/IB
------------------------------------------------------------------
Bra
CBra 1
Any*
X
Alt
^
B
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
First code unit at start or follows newline
Subject length lower bound = 1
/(.*X|^B)/IBs
------------------------------------------------------------------
Bra
CBra 1
AllAny*
X
Alt
^
B
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
Compile options: dotall
Overall options: anchored dotall
Subject length lower bound = 1
/(?s)(.*X|^B)/IB
------------------------------------------------------------------
Bra
CBra 1
AllAny*
X
Alt
^
B
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/(?s:.*X|^B)/IB
------------------------------------------------------------------
Bra
Bra
AllAny*
X
Alt
^
B
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/\Biss\B/I,aftertext
Capturing subpattern count = 0
Max lookbehind = 1
First code unit = 'i'
Last code unit = 's'
Subject length lower bound = 3
Mississippi
0: iss
0+ issippi
/iss/I,aftertext,altglobal
Capturing subpattern count = 0
First code unit = 'i'
Last code unit = 's'
Subject length lower bound = 3
Mississippi
0: iss
0+ issippi
0: iss
0+ ippi
/\Biss\B/I,aftertext,altglobal
Capturing subpattern count = 0
Max lookbehind = 1
First code unit = 'i'
Last code unit = 's'
Subject length lower bound = 3
Mississippi
0: iss
0+ issippi
/\Biss\B/Ig,aftertext
Capturing subpattern count = 0
Max lookbehind = 1
First code unit = 'i'
Last code unit = 's'
Subject length lower bound = 3
Mississippi
0: iss
0+ issippi
0: iss
0+ ippi
\= Expect no match
Mississippi\=anchored
No match
/(?<=[Ms])iss/Ig,aftertext
Capturing subpattern count = 0
Max lookbehind = 1
First code unit = 'i'
Last code unit = 's'
Subject length lower bound = 3
Mississippi
0: iss
0+ issippi
0: iss
0+ ippi
/(?<=[Ms])iss/I,aftertext,altglobal
Capturing subpattern count = 0
Max lookbehind = 1
First code unit = 'i'
Last code unit = 's'
Subject length lower bound = 3
Mississippi
0: iss
0+ issippi
/^iss/Ig,aftertext
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
ississippi
0: iss
0+ issippi
/.*iss/Ig,aftertext
Capturing subpattern count = 0
First code unit at start or follows newline
Last code unit = 's'
Subject length lower bound = 3
abciss\nxyzisspqr
0: abciss
0+ \x0axyzisspqr
0: xyziss
0+ pqr
/.i./Ig,aftertext
Capturing subpattern count = 0
Last code unit = 'i'
Subject length lower bound = 3
Mississippi
0: Mis
0+ sissippi
0: sis
0+ sippi
0: sip
0+ pi
Mississippi\=anchored
0: Mis
0+ sissippi
0: sis
0+ sippi
0: sip
0+ pi
Missouri river
0: Mis
0+ souri river
0: ri
0+ river
0: riv
0+ er
Missouri river\=anchored
0: Mis
0+ souri river
/^.is/Ig,aftertext
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
Mississippi
0: Mis
0+ sissippi
/^ab\n/Ig,aftertext
Capturing subpattern count = 0
Contains explicit CR or LF match
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
ab\nab\ncd
0: ab\x0a
0+ ab\x0acd
/^ab\n/Igm,aftertext
Capturing subpattern count = 0
Contains explicit CR or LF match
Options: multiline
First code unit at start or follows newline
Last code unit = \x0a
Subject length lower bound = 3
ab\nab\ncd
0: ab\x0a
0+ ab\x0acd
0: ab\x0a
0+ cd
/^/gm,newline=any
a\rb\nc\r\nxyz\=aftertext
0:
0+ a\x0db\x0ac\x0d\x0axyz
0:
0+ b\x0ac\x0d\x0axyz
0:
0+ c\x0d\x0axyz
0:
0+ xyz
/abc/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
/abc|bac/I
Capturing subpattern count = 0
Starting code units: a b
Last code unit = 'c'
Subject length lower bound = 3
/(abc|bac)/I
Capturing subpattern count = 1
Starting code units: a b
Last code unit = 'c'
Subject length lower bound = 3
/(abc|(c|dc))/I
Capturing subpattern count = 2
Starting code units: a c d
Last code unit = 'c'
Subject length lower bound = 1
/(abc|(d|de)c)/I
Capturing subpattern count = 2
Starting code units: a d
Last code unit = 'c'
Subject length lower bound = 2
/a*/I
Capturing subpattern count = 0
May match empty string
Subject length lower bound = 0
/a+/I
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 1
/(baa|a+)/I
Capturing subpattern count = 1
Starting code units: a b
Last code unit = 'a'
Subject length lower bound = 1
/a{0,3}/I
Capturing subpattern count = 0
May match empty string
Subject length lower bound = 0
/baa{3,}/I
Capturing subpattern count = 0
First code unit = 'b'
Last code unit = 'a'
Subject length lower bound = 5
/"([^\\"]+|\\.)*"/I
Capturing subpattern count = 1
First code unit = '"'
Last code unit = '"'
Subject length lower bound = 2
/(abc|ab[cd])/I
Capturing subpattern count = 1
First code unit = 'a'
Subject length lower bound = 3
/(a|.)/I
Capturing subpattern count = 1
Subject length lower bound = 1
/a|ba|\w/I
Capturing subpattern count = 0
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
/abc(?=pqr)/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'r'
Subject length lower bound = 3
/...(?<=abc)/I
Capturing subpattern count = 0
Max lookbehind = 3
Subject length lower bound = 3
/abc(?!pqr)/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
/ab./I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 3
/ab[xyz]/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 3
/abc*/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
/ab.c*/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 3
/a.c*/I
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 2
/.c*/I
Capturing subpattern count = 0
Subject length lower bound = 1
/ac*/I
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 1
/(a.c*|b.c*)/I
Capturing subpattern count = 1
Starting code units: a b
Subject length lower bound = 2
/a.c*|aba/I
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 2
/.+a/I
Capturing subpattern count = 0
Last code unit = 'a'
Subject length lower bound = 2
/(?=abcda)a.*/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'a'
Subject length lower bound = 1
/(?=a)a.*/I
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 1
/a(b)*/I
Capturing subpattern count = 1
First code unit = 'a'
Subject length lower bound = 1
/a\d*/I
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 1
/ab\d*/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
/a(\d)*/I
Capturing subpattern count = 1
First code unit = 'a'
Subject length lower bound = 1
/abcde{0,0}/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'd'
Subject length lower bound = 4
/ab\d+/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 3
/a(?(1)b)(.)/I
Capturing subpattern count = 1
Max back reference = 1
First code unit = 'a'
Subject length lower bound = 2
/a(?(1)bag|big)(.)/I
Capturing subpattern count = 1
Max back reference = 1
First code unit = 'a'
Last code unit = 'g'
Subject length lower bound = 5
/a(?(1)bag|big)*(.)/I
Capturing subpattern count = 1
Max back reference = 1
First code unit = 'a'
Subject length lower bound = 2
/a(?(1)bag|big)+(.)/I
Capturing subpattern count = 1
Max back reference = 1
First code unit = 'a'
Last code unit = 'g'
Subject length lower bound = 5
/a(?(1)b..|b..)(.)/I
Capturing subpattern count = 1
Max back reference = 1
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 5
/ab\d{0}e/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'e'
Subject length lower bound = 3
/a?b?/I
Capturing subpattern count = 0
May match empty string
Subject length lower bound = 0
a
0: a
b
0: b
ab
0: ab
\
0:
\= Expect no match
\=notempty
No match
/|-/I
Capturing subpattern count = 0
May match empty string
Subject length lower bound = 0
abcd
0:
-abc
0:
ab-c\=notempty
0: -
\= Expect no match
abc\=notempty
No match
/^.?abcd/I
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Last code unit = 'd'
Subject length lower bound = 4
/\( # ( at start
(?: # Non-capturing bracket
(?>[^()]+) # Either a sequence of non-brackets (no backtracking)
| # Or
(?R) # Recurse - i.e. nested bracketed string
)* # Zero or more contents
\) # Closing )
/Ix
Capturing subpattern count = 0
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
(abcd)
0: (abcd)
(abcd)xyz
0: (abcd)
xyz(abcd)
0: (abcd)
(ab(xy)cd)pqr
0: (ab(xy)cd)
(ab(xycd)pqr
0: (xycd)
() abc ()
0: ()
12(abcde(fsh)xyz(foo(bar))lmno)89
0: (abcde(fsh)xyz(foo(bar))lmno)
\= Expect no match
abcd
No match
abcd)
No match
(abcd
No match
/\( ( (?>[^()]+) | (?R) )* \) /Igx
Capturing subpattern count = 1
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
(ab(xy)cd)pqr
0: (ab(xy)cd)
1: cd
1(abcd)(x(y)z)pqr
0: (abcd)
1: abcd
0: (x(y)z)
1: z
/\( (?: (?>[^()]+) | (?R) ) \) /Ix
Capturing subpattern count = 0
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 3
(abcd)
0: (abcd)
(ab(xy)cd)
0: (xy)
(a(b(c)d)e)
0: (c)
((ab))
0: ((ab))
\= Expect no match
()
No match
/\( (?: (?>[^()]+) | (?R) )? \) /Ix
Capturing subpattern count = 0
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
()
0: ()
12(abcde(fsh)xyz(foo(bar))lmno)89
0: (fsh)
/\( ( (?>[^()]+) | (?R) )* \) /Ix
Capturing subpattern count = 1
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
(ab(xy)cd)
0: (ab(xy)cd)
1: cd
/\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
Capturing subpattern count = 2
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
(ab(xy)cd)
0: (ab(xy)cd)
1: ab(xy)cd
2: cd
/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
Capturing subpattern count = 3
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
(ab(xy)cd)
0: (ab(xy)cd)
1: <unset>
2: ab(xy)cd
3: cd
(123ab(xy)cd)
0: (123ab(xy)cd)
1: 123
2: ab(xy)cd
3: cd
/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
Capturing subpattern count = 3
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
(ab(xy)cd)
0: (ab(xy)cd)
1: ab(xy)cd
2: <unset>
3: cd
(123ab(xy)cd)
0: (123ab(xy)cd)
1: 123ab(xy)cd
2: 123
3: cd
/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
Capturing subpattern count = 11
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
(ab(xy)cd)
0: (ab(xy)cd)
1: ab(xy)cd
2: ab(xy)cd
3: ab(xy)cd
4: ab(xy)cd
5: ab(xy)cd
6: ab(xy)cd
7: ab(xy)cd
8: ab(xy)cd
9: ab(xy)cd
10: ab(xy)cd
11: cd
/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
Capturing subpattern count = 3
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
(abcd(xyz<p>qrs)123)
0: (abcd(xyz<p>qrs)123)
1: abcd(xyz<p>qrs)123
2: 123
/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
Capturing subpattern count = 3
Options: extended
First code unit = '('
Last code unit = ')'
Subject length lower bound = 2
(ab(cd)ef)
0: (ab(cd)ef)
1: ab(cd)ef
2: ef
3: (cd)
(ab(cd(ef)gh)ij)
0: (ab(cd(ef)gh)ij)
1: ab(cd(ef)gh)ij
2: ij
3: (cd(ef)gh)
/^[[:alnum:]]/IB
------------------------------------------------------------------
Bra
^
[0-9A-Za-z]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:^alnum:]]/IB
------------------------------------------------------------------
Bra
^
[\x00-/:-@[-`{-\xff] (neg)
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:alpha:]]/IB
------------------------------------------------------------------
Bra
^
[A-Za-z]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:^alpha:]]/IB
------------------------------------------------------------------
Bra
^
[\x00-@[-`{-\xff] (neg)
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/[_[:alpha:]]/I
Capturing subpattern count = 0
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
/^[[:ascii:]]/IB
------------------------------------------------------------------
Bra
^
[\x00-\x7f]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:^ascii:]]/IB
------------------------------------------------------------------
Bra
^
[\x80-\xff] (neg)
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:blank:]]/IB
------------------------------------------------------------------
Bra
^
[\x09 ]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:^blank:]]/IB
------------------------------------------------------------------
Bra
^
[\x00-\x08\x0a-\x1f!-\xff] (neg)
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/[\n\x0b\x0c\x0d[:blank:]]/I
Capturing subpattern count = 0
Contains explicit CR or LF match
Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
Subject length lower bound = 1
/^[[:cntrl:]]/IB
------------------------------------------------------------------
Bra
^
[\x00-\x1f\x7f]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:digit:]]/IB
------------------------------------------------------------------
Bra
^
[0-9]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:graph:]]/IB
------------------------------------------------------------------
Bra
^
[!-~]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:lower:]]/IB
------------------------------------------------------------------
Bra
^
[a-z]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:print:]]/IB
------------------------------------------------------------------
Bra
^
[ -~]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:punct:]]/IB
------------------------------------------------------------------
Bra
^
[!-/:-@[-`{-~]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:space:]]/IB
------------------------------------------------------------------
Bra
^
[\x09-\x0d ]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:upper:]]/IB
------------------------------------------------------------------
Bra
^
[A-Z]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:xdigit:]]/IB
------------------------------------------------------------------
Bra
^
[0-9A-Fa-f]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:word:]]/IB
------------------------------------------------------------------
Bra
^
[0-9A-Z_a-z]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:^cntrl:]]/IB
------------------------------------------------------------------
Bra
^
[ -~\x80-\xff] (neg)
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[12[:^digit:]]/IB
------------------------------------------------------------------
Bra
^
[\x00-/12:-\xff] (neg)
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/^[[:^blank:]]/IB
------------------------------------------------------------------
Bra
^
[\x00-\x08\x0a-\x1f!-\xff] (neg)
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
/[01[:alpha:]%]/IB
------------------------------------------------------------------
Bra
[%01A-Za-z]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Starting code units: % 0 1 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
/[[.ch.]]/I
Failed: error 113 at offset 1: POSIX collating elements are not supported
/[[=ch=]]/I
Failed: error 113 at offset 1: POSIX collating elements are not supported
/[[:rhubarb:]]/I
Failed: error 130 at offset 3: unknown POSIX class name
/[[:upper:]]/Ii
Capturing subpattern count = 0
Options: caseless
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
A
0: A
a
0: a
/[[:lower:]]/Ii
Capturing subpattern count = 0
Options: caseless
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
A
0: A
a
0: a
/((?-i)[[:lower:]])[[:lower:]]/Ii
Capturing subpattern count = 1
Options: caseless
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 = 2
ab
0: ab
1: a
aB
0: aB
1: a
\= Expect no match
Ab
No match
AB
No match
/[\200-\110]/I
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)
# This one's here because of the large output vector needed
/(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/I
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
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
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
10: 10
11: 11
12: 12
13: 13
14: 14
15: 15
16: 16
17: 17
18: 18
19: 19
20: 20
21: 21
22: 22
23: 23
24: 24
25: 25
26: 26
27: 27
28: 28
29: 29
30: 30
31: 31
32: 32
33: 33
34: 34
35: 35
36: 36
37: 37
38: 38
39: 39
40: 40
41: 41
42: 42
43: 43
44: 44
45: 45
46: 46
47: 47
48: 48
49: 49
50: 50
51: 51
52: 52
53: 53
54: 54
55: 55
56: 56
57: 57
58: 58
59: 59
60: 60
61: 61
62: 62
63: 63
64: 64
65: 65
66: 66
67: 67
68: 68
69: 69
70: 70
71: 71
72: 72
73: 73
74: 74
75: 75
76: 76
77: 77
78: 78
79: 79
80: 80
81: 81
82: 82
83: 83
84: 84
85: 85
86: 86
87: 87
88: 88
89: 89
90: 90
91: 91
92: 92
93: 93
94: 94
95: 95
96: 96
97: 97
98: 98
99: 99
100: 100
101: 101
102: 102
103: 103
104: 104
105: 105
106: 106
107: 107
108: 108
109: 109
110: 110
111: 111
112: 112
113: 113
114: 114
115: 115
116: 116
117: 117
118: 118
119: 119
120: 120
121: 121
122: 122
123: 123
124: 124
125: 125
126: 126
127: 127
128: 128
129: 129
130: 130
131: 131
132: 132
133: 133
134: 134
135: 135
136: 136
137: 137
138: 138
139: 139
140: 140
141: 141
142: 142
143: 143
144: 144
145: 145
146: 146
147: 147
148: 148
149: 149
150: 150
151: 151
152: 152
153: 153
154: 154
155: 155
156: 156
157: 157
158: 158
159: 159
160: 160
161: 161
162: 162
163: 163
164: 164
165: 165
166: 166
167: 167
168: 168
169: 169
170: 170
171: 171
172: 172
173: 173
174: 174
175: 175
176: 176
177: 177
178: 178
179: 179
180: 180
181: 181
182: 182
183: 183
184: 184
185: 185
186: 186
187: 187
188: 188
189: 189
190: 190
191: 191
192: 192
193: 193
194: 194
195: 195
196: 196
197: 197
198: 198
199: 199
200: 200
201: 201
202: 202
203: 203
204: 204
205: 205
206: 206
207: 207
208: 208
209: 209
210: 210
211: 211
212: 212
213: 213
214: 214
215: 215
216: 216
217: 217
218: 218
219: 219
220: 220
221: 221
222: 222
223: 223
224: 224
225: 225
226: 226
227: 227
228: 228
229: 229
230: 230
231: 231
232: 232
233: 233
234: 234
235: 235
236: 236
237: 237
238: 238
239: 239
240: 240
241: 241
242: 242
243: 243
244: 244
245: 245
246: 246
247: 247
248: 248
249: 249
250: 250
251: 251
252: 252
253: 253
254: 254
255: 255
256: 256
257: 257
258: 258
259: 259
260: 260
261: 261
262: 262
263: 263
264: 264
265: 265
266: 266
267: 267
268: 268
269: 269
270: ABC
271: ABC
# This one's here because Perl does this differently and PCRE2 can't at present
/(main(O)?)+/I
Capturing subpattern count = 2
First code unit = 'm'
Last code unit = 'n'
Subject length lower bound = 4
mainmain
0: mainmain
1: main
mainOmain
0: mainOmain
1: main
2: O
# These are all cases where Perl does it differently (nested captures)
/^(a(b)?)+$/I
Capturing subpattern count = 2
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
aba
0: aba
1: a
2: b
/^(aa(bb)?)+$/I
Capturing subpattern count = 2
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbaa
0: aabbaa
1: aa
2: bb
/^(aa|aa(bb))+$/I
Capturing subpattern count = 2
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbaa
0: aabbaa
1: aa
2: bb
/^(aa(bb)??)+$/I
Capturing subpattern count = 2
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbaa
0: aabbaa
1: aa
2: bb
/^(?:aa(bb)?)+$/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbaa
0: aabbaa
1: bb
/^(aa(b(b))?)+$/I
Capturing subpattern count = 3
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbaa
0: aabbaa
1: aa
2: bb
3: b
/^(?:aa(b(b))?)+$/I
Capturing subpattern count = 2
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbaa
0: aabbaa
1: bb
2: b
/^(?:aa(b(?:b))?)+$/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbaa
0: aabbaa
1: bb
/^(?:aa(bb(?:b))?)+$/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbbaa
0: aabbbaa
1: bbb
/^(?:aa(b(?:bb))?)+$/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbbaa
0: aabbbaa
1: bbb
/^(?:aa(?:b(b))?)+$/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbaa
0: aabbaa
1: b
/^(?:aa(?:b(bb))?)+$/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbbaa
0: aabbbaa
1: bb
/^(aa(b(bb))?)+$/I
Capturing subpattern count = 3
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbbaa
0: aabbbaa
1: aa
2: bbb
3: bb
/^(aa(bb(bb))?)+$/I
Capturing subpattern count = 3
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
aabbbbaa
0: aabbbbaa
1: aa
2: bbbb
3: bb
# ----------------
/#/IBx
------------------------------------------------------------------
Bra
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
May match empty string
Options: extended
Subject length lower bound = 0
/a#/IBx
------------------------------------------------------------------
Bra
a
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Options: extended
First code unit = 'a'
Subject length lower bound = 1
/[\s]/IB
------------------------------------------------------------------
Bra
[\x09-\x0d ]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
Subject length lower bound = 1
/[\S]/IB
------------------------------------------------------------------
Bra
[\x00-\x08\x0e-\x1f!-\xff] (neg)
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \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
/a(?i)b/IB
------------------------------------------------------------------
Bra
a
/i b
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b' (caseless)
Subject length lower bound = 2
ab
0: ab
aB
0: aB
\= Expect no match
AB
No match
/(a(?i)b)/IB
------------------------------------------------------------------
Bra
CBra 1
a
/i b
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'b' (caseless)
Subject length lower bound = 2
ab
0: ab
1: ab
aB
0: aB
1: aB
\= Expect no match
AB
No match
/ (?i)abc/IBx
------------------------------------------------------------------
Bra
/i abc
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Options: extended
First code unit = 'a' (caseless)
Last code unit = 'c' (caseless)
Subject length lower bound = 3
/#this is a comment
(?i)abc/IBx
------------------------------------------------------------------
Bra
/i abc
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Options: extended
First code unit = 'a' (caseless)
Last code unit = 'c' (caseless)
Subject length lower bound = 3
/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
------------------------------------------------------------------
Bra
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = '1'
Last code unit = '0'
Subject length lower bound = 300
/\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
------------------------------------------------------------------
Bra
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = '1'
Last code unit = '0'
Subject length lower bound = 300
/\Q\E/IB
------------------------------------------------------------------
Bra
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
May match empty string
Subject length lower bound = 0
\
0:
/\Q\Ex/IB
------------------------------------------------------------------
Bra
x
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = 'x'
Subject length lower bound = 1
/ \Q\E/IB
------------------------------------------------------------------
Bra
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = ' '
Subject length lower bound = 1
/a\Q\E/IB
------------------------------------------------------------------
Bra
a
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 1
abc
0: a
bca
0: a
bac
0: a
/a\Q\Eb/IB
------------------------------------------------------------------
Bra
ab
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
abc
0: ab
/\Q\Eabc/IB
------------------------------------------------------------------
Bra
abc
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
/x*+\w/IB
------------------------------------------------------------------
Bra
x*+
\w
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
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
\= Expect no match
xxxxx
No match
/x?+/IB
------------------------------------------------------------------
Bra
x?+
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
May match empty string
Subject length lower bound = 0
/x++/IB
------------------------------------------------------------------
Bra
x++
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = 'x'
Subject length lower bound = 1
/x{1,3}+/B,no_auto_possess
------------------------------------------------------------------
Bra
x
x{0,2}+
Ket
End
------------------------------------------------------------------
/x{1,3}+/Bi,no_auto_possess
------------------------------------------------------------------
Bra
/i x
/i x{0,2}+
Ket
End
------------------------------------------------------------------
/[^x]{1,3}+/B,no_auto_possess
------------------------------------------------------------------
Bra
[^x]
[^x]{0,2}+
Ket
End
------------------------------------------------------------------
/[^x]{1,3}+/Bi,no_auto_possess
------------------------------------------------------------------
Bra
/i [^x]
/i [^x]{0,2}+
Ket
End
------------------------------------------------------------------
/(x)*+/IB
------------------------------------------------------------------
Bra
Braposzero
CBraPos 1
x
KetRpos
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
May match empty string
Subject length lower bound = 0
/^(\w++|\s++)*$/I
Capturing subpattern count = 1
May match empty string
Compile options: <none>
Overall options: anchored
Subject length lower bound = 0
now is the time for all good men to come to the aid of the party
0: now is the time for all good men to come to the aid of the party
1: party
\= Expect no match
this is not a line with only words and spaces!
No match
/(\d++)(\w)/I
Capturing subpattern count = 2
Starting code units: 0 1 2 3 4 5 6 7 8 9
Subject length lower bound = 2
12345a
0: 12345a
1: 12345
2: a
\= Expect no match
12345+
No match
/a++b/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
aaab
0: aaab
/(a++b)/I
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
aaab
0: aaab
1: aaab
/(a++)b/I
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
aaab
0: aaab
1: aaa
/([^()]++|\([^()]*\))+/I
Capturing subpattern count = 1
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
\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
((abc(ade)ufh()()x
0: abc(ade)ufh()()x
1: x
/\(([^()]++|\([^()]+\))+\)/I
Capturing subpattern count = 1
First code unit = '('
Last code unit = ')'
Subject length lower bound = 3
(abc)
0: (abc)
1: abc
(abc(def)xyz)
0: (abc(def)xyz)
1: xyz
\= Expect no match
((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
No match
/(abc){1,3}+/IB
------------------------------------------------------------------
Bra
Once
CBra 1
abc
Ket
Brazero
Bra
CBra 1
abc
Ket
Brazero
CBra 1
abc
Ket
Ket
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
/a+?+/I
Failed: error 109 at offset 3: quantifier does not follow a repeatable item
/a{2,3}?+b/I
Failed: error 109 at offset 7: quantifier does not follow a repeatable item
/(?U)a+?+/I
Failed: error 109 at offset 7: quantifier does not follow a repeatable item
/a{2,3}?+b/I,ungreedy
Failed: error 109 at offset 7: quantifier does not follow a repeatable item
/x(?U)a++b/IB
------------------------------------------------------------------
Bra
x
a++
b
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = 'x'
Last code unit = 'b'
Subject length lower bound = 3
xaaaab
0: xaaaab
/(?U)xa++b/IB
------------------------------------------------------------------
Bra
x
a++
b
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
First code unit = 'x'
Last code unit = 'b'
Subject length lower bound = 3
xaaaab
0: xaaaab
/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/IB
------------------------------------------------------------------
Bra
^
CBra 1
CBra 2
a+
Ket
CBra 3
[ab]+?
Ket
CBra 4
[bc]+
Ket
CBra 5
\w*+
Ket
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 5
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
/^x(?U)a+b/IB
------------------------------------------------------------------
Bra
^
x
a++
b
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Last code unit = 'b'
Subject length lower bound = 3
/^x(?U)(a+)b/IB
------------------------------------------------------------------
Bra
^
x
CBra 1
a+?
Ket
b
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Last code unit = 'b'
Subject length lower bound = 3
/[.x.]/I
Failed: error 113 at offset 0: POSIX collating elements are not supported
/[=x=]/I
Failed: error 113 at offset 0: POSIX collating elements are not supported
/[:x:]/I
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
/\L/I
Failed: error 137 at offset 1: 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
/\u/I
Failed: error 137 at offset 1: 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
/a{1,3}b/ungreedy
ab
0: ab
/[/I
Failed: error 106 at offset 1: missing terminating ] for character class
/[a-/I
Failed: error 106 at offset 3: missing terminating ] for character class
/[[:space:]/I
Failed: error 106 at offset 10: missing terminating ] for character class
/[\s]/IB
------------------------------------------------------------------
Bra
[\x09-\x0d ]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
Subject length lower bound = 1
/[[:space:]]/IB
------------------------------------------------------------------
Bra
[\x09-\x0d ]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
Subject length lower bound = 1
/[[:space:]abcde]/IB
------------------------------------------------------------------
Bra
[\x09-\x0d a-e]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b c d e
Subject length lower bound = 1
/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix
Capturing subpattern count = 0
Options: extended
First code unit = '<'
Last code unit = '>'
Subject length lower bound = 2
<>
0: <>
<abcd>
0: <abcd>
<abc <123> hij>
0: <abc <123> hij>
<abc <def> hij>
0: <def>
<abc<>def>
0: <abc<>def>
<abc<>
0: <>
\= Expect no match
<abc
No match
/8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b/IB
------------------------------------------------------------------
Bra
8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
\b
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Max lookbehind = 1
First code unit = '8'
Last code unit = 'X'
Subject length lower bound = 409
/\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b/IB
------------------------------------------------------------------
Bra
$<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
\b
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Max lookbehind = 1
First code unit = '$'
Last code unit = 'X'
Subject length lower bound = 404
/(.*)\d+\1/I
Capturing subpattern count = 1
Max back reference = 1
Subject length lower bound = 1
/(.*)\d+/I
Capturing subpattern count = 1
First code unit at start or follows newline
Subject length lower bound = 1
/(.*)\d+\1/Is
Capturing subpattern count = 1
Max back reference = 1
Options: dotall
Subject length lower bound = 1
/(.*)\d+/Is
Capturing subpattern count = 1
Compile options: dotall
Overall options: anchored dotall
Subject length lower bound = 1
/(.*(xyz))\d+\2/I
Capturing subpattern count = 2
Max back reference = 2
First code unit at start or follows newline
Last code unit = 'z'
Subject length lower bound = 7
/((.*))\d+\1/I
Capturing subpattern count = 2
Max back reference = 1
Subject length lower bound = 1
abc123bc
0: bc123bc
1: bc
2: bc
/a[b]/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
/(?=a).*/I
Capturing subpattern count = 0
May match empty string
First code unit = 'a'
Subject length lower bound = 0
/(?=abc).xyz/Ii
Capturing subpattern count = 0
Options: caseless
First code unit = 'a' (caseless)
Last code unit = 'z' (caseless)
Subject length lower bound = 4
/(?=abc)(?i).xyz/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'z' (caseless)
Subject length lower bound = 4
/(?=a)(?=b)/I
Capturing subpattern count = 0
May match empty string
First code unit = 'a'
Subject length lower bound = 0
/(?=.)a/I
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 1
/((?=abcda)a)/I
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'a'
Subject length lower bound = 1
/((?=abcda)ab)/I
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
/()a/I
Capturing subpattern count = 1
First code unit = 'a'
Subject length lower bound = 1
/(?:(?=.)|(?<!x))a/I
Capturing subpattern count = 0
Max lookbehind = 1
First code unit = 'a'
Subject length lower bound = 1
/(?(1)ab|ac)(.)/I
Capturing subpattern count = 1
Max back reference = 1
First code unit = 'a'
Subject length lower bound = 3
/(?(1)abz|acz)(.)/I
Capturing subpattern count = 1
Max back reference = 1
First code unit = 'a'
Last code unit = 'z'
Subject length lower bound = 4
/(?(1)abz)(.)/I
Capturing subpattern count = 1
Max back reference = 1
Subject length lower bound = 1
/(?(1)abz)(1)23/I
Capturing subpattern count = 1
Max back reference = 1
Last code unit = '3'
Subject length lower bound = 3
/(a)+/I
Capturing subpattern count = 1
First code unit = 'a'
Subject length lower bound = 1
/(a){2,3}/I
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'a'
Subject length lower bound = 2
/(a)*/I
Capturing subpattern count = 1
May match empty string
Subject length lower bound = 0
/[a]/I
Capturing subpattern count = 0
First code unit = 'a'
Subject length lower bound = 1
/[ab]/I
Capturing subpattern count = 0
Starting code units: a b
Subject length lower bound = 1
/[ab]/I
Capturing subpattern count = 0
Starting code units: a b
Subject length lower bound = 1
/[^a]/I
Capturing subpattern count = 0
Subject length lower bound = 1
/\d456/I
Capturing subpattern count = 0
Starting code units: 0 1 2 3 4 5 6 7 8 9
Last code unit = '6'
Subject length lower bound = 4
/\d456/I
Capturing subpattern count = 0
Starting code units: 0 1 2 3 4 5 6 7 8 9
Last code unit = '6'
Subject length lower bound = 4
/a^b/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
/^a/Im
Capturing subpattern count = 0
Options: multiline
First code unit at start or follows newline
Last code unit = 'a'
Subject length lower bound = 1
abcde
0: a
xy\nabc
0: a
\= Expect no match
xyabc
No match
/c|abc/I
Capturing subpattern count = 0
Starting code units: a c
Last code unit = 'c'
Subject length lower bound = 1
/(?i)[ab]/I
Capturing subpattern count = 0
Starting code units: A B a b
Subject length lower bound = 1
/[ab](?i)cd/I
Capturing subpattern count = 0
Starting code units: a b
Last code unit = 'd' (caseless)
Subject length lower bound = 3
/abc(?C)def/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'f'
Subject length lower bound = 6
abcdef
--->abcdef
0 ^ ^ d
0: abcdef
1234abcdef
--->1234abcdef
0 ^ ^ d
0: abcdef
\= Expect no match
abcxyz
No match
abcxyzf
--->abcxyzf
0 ^ ^ d
No match
/abc(?C)de(?C1)f/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'f'
Subject length lower bound = 6
123abcdef
--->123abcdef
0 ^ ^ d
1 ^ ^ f
0: abcdef
/(?C1)\dabc(?C2)def/I
Capturing subpattern count = 0
Starting code units: 0 1 2 3 4 5 6 7 8 9
Last code unit = 'f'
Subject length lower bound = 7
1234abcdef
--->1234abcdef
1 ^ \d
1 ^ \d
1 ^ \d
1 ^ \d
2 ^ ^ d
0: 4abcdef
\= Expect no match
abcdef
No match
/(?C1)\dabc(?C2)def/I
Capturing subpattern count = 0
Starting code units: 0 1 2 3 4 5 6 7 8 9
Last code unit = 'f'
Subject length lower bound = 7
1234abcdef
--->1234abcdef
1 ^ \d
1 ^ \d
1 ^ \d
1 ^ \d
2 ^ ^ d
0: 4abcdef
\= Expect no match
abcdef
No match
/(?C255)ab/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
/(?C256)ab/I
Failed: error 138 at offset 6: number after (?C is greater than 255
/(?Cab)xx/I
Failed: error 182 at offset 3: unrecognized string delimiter follows (?C
/(?C12vr)x/I
Failed: error 139 at offset 5: closing parenthesis for (?C expected
/abc(?C)def/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'f'
Subject length lower bound = 6
\x83\x0\x61bcdef
--->\x83\x00abcdef
0 ^ ^ d
0: abcdef
/(abc)(?C)de(?C1)f/I
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'f'
Subject length lower bound = 6
123abcdef
--->123abcdef
0 ^ ^ d
1 ^ ^ f
0: abcdef
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
0: abcdef
1: abc
123abcdefC-\=callout_none
0: abcdef
1: abc
\= Expect no match
123abcdef\=callout_fail=1
--->123abcdef
0 ^ ^ d
1 ^ ^ f
No match
/(?C0)(abc(?C1))*/I
Capturing subpattern count = 1
May match empty string
Subject length lower bound = 0
abcabcabc
--->abcabcabc
0 ^ (abc(?C1))*
1 ^ ^ )
1 ^ ^ )
1 ^ ^ )
0: abcabcabc
1: abc
abcabc\=callout_fail=1:3
--->abcabc
0 ^ (abc(?C1))*
1 ^ ^ )
1 ^ ^ )
0: abcabc
1: abc
abcabcabc\=callout_fail=1:3
--->abcabcabc
0 ^ (abc(?C1))*
1 ^ ^ )
1 ^ ^ )
1 ^ ^ )
0: abcabc
1: abc
/(\d{3}(?C))*/I
Capturing subpattern count = 1
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
/((xyz)(?C)p|(?C1)xyzabc)/I
Capturing subpattern count = 2
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
1: xyzabc
/(X)((xyz)(?C)p|(?C1)xyzabc)/I
Capturing subpattern count = 3
First code unit = 'X'
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
0: Xxyzabc
1: X
2: xyzabc
/(?=(abc))(?C)abcdef/I
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'f'
Subject length lower bound = 6
abcdef\=callout_capture
Callout 0: last capture = 1
0: <unset>
1: abc
--->abcdef
^ a
0: abcdef
1: abc
/(?!(abc)(?C1)d)(?C2)abcxyz/I
Capturing subpattern count = 1
First code unit = 'a'
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
/(?<=(abc)(?C))xyz/I
Capturing subpattern count = 1
Max lookbehind = 3
First code unit = 'x'
Last code unit = 'z'
Subject length lower bound = 3
abcxyz\=callout_capture
Callout 0: last capture = 1
0: <unset>
1: abc
--->abcxyz
^ )
0: xyz
1: abc
/a(b+)(c*)(?C1)/I
Capturing subpattern count = 2
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
\= Expect no match
abbbbbccc\=callout_data=1
--->abbbbbccc
1 ^ ^
Callout data = 1
No match
/a(b+?)(c*?)(?C1)/I
Capturing subpattern count = 2
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
\= Expect no match
abbbbbccc\=callout_data=1
--->abbbbbccc
1 ^ ^
Callout data = 1
1 ^ ^
Callout data = 1
1 ^ ^
Callout data = 1
1 ^ ^
Callout data = 1
1 ^ ^
Callout data = 1
1 ^ ^
Callout data = 1
1 ^ ^
Callout data = 1
1 ^ ^
Callout data = 1
No match
/(?C)abc/I
Capturing subpattern count = 0
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
/(?C)^abc/I
Capturing subpattern count = 0
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
/(?C)a|b/I
Capturing subpattern count = 0
Starting code units: a b
Subject length lower bound = 1
/x(ab|(bc|(de|(?R))))/I
Capturing subpattern count = 3
First code unit = 'x'
Subject length lower bound = 3
xab
0: xab
1: ab
xbc
0: xbc
1: bc
2: bc
xde
0: xde
1: de
2: de
3: de
xxab
0: xxab
1: xab
2: xab
3: xab
xxxab
0: xxxab
1: xxab
2: xxab
3: xxab
\= Expect no match
xyab
No match
/^([^()]|\((?1)*\))*$/I
Capturing subpattern count = 1
May match empty string
Compile options: <none>
Overall options: anchored
Subject length lower bound = 0
abc
0: abc
1: c
a(b)c
0: a(b)c
1: c
a(b(c))d
0: a(b(c))d
1: d
\= Expect no match)
a(b(c)d
No match
/^>abc>([^()]|\((?1)*\))*<xyz<$/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Last code unit = '<'
Subject length lower bound = 10
>abc>123<xyz<
0: >abc>123<xyz<
1: 3
>abc>1(2)3<xyz<
0: >abc>1(2)3<xyz<
1: 3
>abc>(1(2)3)<xyz<
0: >abc>(1(2)3)<xyz<
1: (1(2)3)
/(a(?1)b)/IB
------------------------------------------------------------------
Bra
CBra 1
a
Recurse
b
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
/(a(?1)+b)/IB
------------------------------------------------------------------
Bra
CBra 1
a
Once
Recurse
KetRmax
b
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
Capturing subpattern count = 2
Compile options: <none>
Overall options: anchored
Subject length lower bound = 1
12
0: 12
1: 12
(((2+2)*-3)-7)
0: (((2+2)*-3)-7)
1: (((2+2)*-3)-7)
2: -
-12
0: -12
1: -12
\= Expect no match
((2+2)*-3)-7)
No match
/^(x(y|(?1){2})z)/I
Capturing subpattern count = 2
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
xyz
0: xyz
1: xyz
2: y
xxyzxyzz
0: xxyzxyzz
1: xxyzxyzz
2: xyzxyz
\= Expect no match
xxyzz
No match
xxyzxyzxyzz
No match
/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/Ix
Capturing subpattern count = 2
Options: extended
First code unit = '<'
Last code unit = '>'
Subject length lower bound = 2
<>
0: <>
1: <>
2: <>
<abcd>
0: <abcd>
1: <abcd>
2: <abcd>
<abc <123> hij>
0: <abc <123> hij>
1: <abc <123> hij>
2: <abc <123> hij>
<abc <def> hij>
0: <def>
1: <def>
2: <def>
<abc<>def>
0: <abc<>def>
1: <abc<>def>
2: <abc<>def>
<abc<>
0: <>
1: <>
2: <>
\= Expect no match
<abc
No match
/(?1)/I
Failed: error 115 at offset 3: reference to non-existent subpattern
/((?2)(abc)/I
Failed: error 114 at offset 10: missing closing parenthesis
/^(abc)def(?1)/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 9
abcdefabc
0: abcdefabc
1: abc
/^(a|b|c)=(?1)+/I
Capturing subpattern count = 1
Compile options: <none>
Overall options: anchored
Subject length lower bound = 3
a=a
0: a=a
1: a
a=b
0: a=b
1: a
a=bc
0: a=bc
1: a
/^(a|b|c)=((?1))+/I
Capturing subpattern count = 2
Compile options: <none>
Overall options: anchored
Subject length lower bound = 2
a=a
0: a=a
1: a
2: a
a=b
0: a=b
1: a
2: b
a=bc
0: a=bc
1: a
2: c
/a(?P<name1>b|c)d(?P<longername2>e)/IB
------------------------------------------------------------------
Bra
a
CBra 1
b
Alt
c
Ket
d
CBra 2
e
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 2
Named capturing subpatterns:
longername2 2
name1 1
First code unit = 'a'
Last code unit = 'e'
Subject length lower bound = 4
abde
0: abde
1: b
2: e
acde
0: acde
1: c
2: e
/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/IB
------------------------------------------------------------------
Bra
Bra
a
CBra 1
c
CBra 2
d
Ket
Ket
Ket
CBra 3
a
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 3
Named capturing subpatterns:
a 3
c 1
d 2
First code unit = 'a'
Last code unit = 'a'
Subject length lower bound = 4
/(?P<a>a)...(?P=a)bbb(?P>a)d/IB
------------------------------------------------------------------
Bra
CBra 1
a
Ket
Any
Any
Any
\1
bbb
Recurse
d
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
Max back reference = 1
Named capturing subpatterns:
a 1
First code unit = 'a'
Last code unit = 'd'
Subject length lower bound = 10
/^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii
Capturing subpattern count = 4
Max back reference = 4
Named capturing subpatterns:
four 4
one 1
three 3
two 2
May match empty string
Compile options: caseless
Overall options: anchored caseless
Subject length lower bound = 0
1221
0: 1221
1: 1221
2: 1
Satan, oscillate my metallic sonatas!
0: Satan, oscillate my metallic sonatas!
1: <unset>
2: <unset>
3: Satan, oscillate my metallic sonatas
4: S
A man, a plan, a canal: Panama!
0: A man, a plan, a canal: Panama!
1: <unset>
2: <unset>
3: A man, a plan, a canal: Panama
4: A
Able was I ere I saw Elba.
0: Able was I ere I saw Elba.
1: <unset>
2: <unset>
3: Able was I ere I saw Elba
4: A
\= Expect no match
The quick brown fox
No match
/((?(R)a|b))\1(?1)?/I
Capturing subpattern count = 1
Max back reference = 1
Subject length lower bound = 2
bb
0: bb
1: b
bbaa
0: bba
1: b
/(.*)a/Is
Capturing subpattern count = 1
Compile options: dotall
Overall options: anchored dotall
Last code unit = 'a'
Subject length lower bound = 1
/(.*)a\1/Is
Capturing subpattern count = 1
Max back reference = 1
Options: dotall
Last code unit = 'a'
Subject length lower bound = 1
/(.*)a(b)\2/Is
Capturing subpattern count = 2
Max back reference = 2
Compile options: dotall
Overall options: anchored dotall
Last code unit = 'b'
Subject length lower bound = 3
/((.*)a|(.*)b)z/Is
Capturing subpattern count = 3
Compile options: dotall
Overall options: anchored dotall
Last code unit = 'z'
Subject length lower bound = 2
/((.*)a|(.*)b)z\1/Is
Capturing subpattern count = 3
Max back reference = 1
Options: dotall
Last code unit = 'z'
Subject length lower bound = 3
/((.*)a|(.*)b)z\2/Is
Capturing subpattern count = 3
Max back reference = 2
Options: dotall
Last code unit = 'z'
Subject length lower bound = 2
/((.*)a|(.*)b)z\3/Is
Capturing subpattern count = 3
Max back reference = 3
Options: dotall
Last code unit = 'z'
Subject length lower bound = 2
/((.*)a|^(.*)b)z\3/Is
Capturing subpattern count = 3
Max back reference = 3
Compile options: dotall
Overall options: anchored dotall
Last code unit = 'z'
Subject length lower bound = 2
/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
Capturing subpattern count = 31
May match empty string
Compile options: dotall
Overall options: anchored dotall
Subject length lower bound = 0
/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
Capturing subpattern count = 31
Max back reference = 31
May match empty string
Options: dotall
Subject length lower bound = 0
/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
Capturing subpattern count = 32
Max back reference = 32
May match empty string
Options: dotall
Subject length lower bound = 0
/(a)(bc)/IB,no_auto_capture
------------------------------------------------------------------
Bra
Bra
a
Ket
Bra
bc
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
Options: no_auto_capture
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
abc
0: abc
/(?P<one>a)(bc)/IB,no_auto_capture
------------------------------------------------------------------
Bra
CBra 1
a
Ket
Bra
bc
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
Named capturing subpatterns:
one 1
Options: no_auto_capture
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
abc
0: abc
1: a
/(a)(?P<named>bc)/IB,no_auto_capture
------------------------------------------------------------------
Bra
Bra
a
Ket
CBra 1
bc
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 1
Named capturing subpatterns:
named 1
Options: no_auto_capture
First code unit = 'a'
Last code unit = 'c'
Subject length lower bound = 3
/(aaa(?C1)bbb|ab)/I
Capturing subpattern count = 1
First code unit = 'a'
Last code unit = 'b'
Subject length lower bound = 2
aaabbb
--->aaabbb
1 ^ ^ b
0: aaabbb
1: aaabbb
aaabbb\=callout_data=0
--->aaabbb
1 ^ ^ b
0: aaabbb
1: aaabbb
aaabbb\=callout_data=1
--->aaabbb
1 ^ ^ b
Callout data = 1
0: ab
1: ab
\= Expect no match
aaabbb\=callout_data=-1
--->aaabbb
1 ^ ^ b
Callout data = -1
No match
/ab(?P<one>cd)ef(?P<two>gh)/I
Capturing subpattern count = 2
Named capturing subpatterns:
one 1
two 2
First code unit = 'a'
Last code unit = 'h'
Subject length lower bound = 8
abcdefgh
0: abcdefgh
1: cd
2: gh
abcdefgh\=copy=1,get=two
0: abcdefgh
1: cd
2: gh
1C cd (2)
G gh (2) two (group 2)
abcdefgh\=copy=one,copy=two
0: abcdefgh
1: cd
2: gh
C cd (2) one (group 1)
C gh (2) two (group 2)
abcdefgh\=copy=three
0: abcdefgh
1: cd
2: gh
Number not found for group 'three'
Copy substring 'three' failed (-49): unknown substring
/(?P<Tes>)(?P<Test>)/IB
------------------------------------------------------------------
Bra
CBra 1
Ket
CBra 2
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 2
Named capturing subpatterns:
Tes 1
Test 2
May match empty string
Subject length lower bound = 0
/(?P<Test>)(?P<Tes>)/IB
------------------------------------------------------------------
Bra
CBra 1
Ket
CBra 2
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 2
Named capturing subpatterns:
Tes 2
Test 1
May match empty string
Subject length lower bound = 0
/(?P<Z>zz)(?P<A>aa)/I
Capturing subpattern count = 2
Named capturing subpatterns:
A 2
Z 1
First code unit = 'z'
Last code unit = 'a'
Subject length lower bound = 4
zzaa\=copy=Z
0: zzaa
1: zz
2: aa
C zz (2) Z (group 1)
zzaa\=copy=A
0: zzaa
1: zz
2: aa
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)
/(?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)
"\[((?P<elem>\d+)(,(?P>elem))*)\]"I
Capturing subpattern count = 3
Named capturing subpatterns:
elem 2
First code unit = '['
Last code unit = ']'
Subject length lower bound = 3
[10,20,30,5,5,4,4,2,43,23,4234]
0: [10,20,30,5,5,4,4,2,43,23,4234]
1: 10,20,30,5,5,4,4,2,43,23,4234
2: 10
3: ,4234
\= Expect no match
[]
No match
"\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
Capturing subpattern count = 3
Named capturing subpatterns:
elem 2
First code unit = '['
Last code unit = ']'
Subject length lower bound = 2
[10,20,30,5,5,4,4,2,43,23,4234]
0: [10,20,30,5,5,4,4,2,43,23,4234]
1: 10,20,30,5,5,4,4,2,43,23,4234
2: 10
3: ,4234
[]
0: []
/(a(b(?2)c))?/IB
------------------------------------------------------------------
Bra
Brazero
CBra 1
a
CBra 2
b
Recurse
c
Ket
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 2
May match empty string
Subject length lower bound = 0
/(a(b(?2)c))*/IB
------------------------------------------------------------------
Bra
Brazero
CBra 1
a
CBra 2
b
Recurse
c
Ket
KetRmax
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 2
May match empty string
Subject length lower bound = 0
/(a(b(?2)c)){0,2}/IB
------------------------------------------------------------------
Bra
Brazero
Bra
CBra 1
a
CBra 2
b
Recurse
c
Ket
Ket
Brazero
CBra 1
a
CBra 2
b
Recurse
c
Ket
Ket
Ket
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 2
May match empty string
Subject length lower bound = 0
/[ab]{1}+/B
------------------------------------------------------------------
Bra
[ab]
Ket
End
------------------------------------------------------------------
/()(?1){1}/B
------------------------------------------------------------------
Bra
CBra 1
Ket
Recurse
Ket
End
------------------------------------------------------------------