## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements.  See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License.  You may obtain a copy of the License at
##
##     http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

#1
abc
abc
YES
1
abc

#2
abc
xbc
NO

#3
abc
axc
NO

#4
abc
abx
NO

#5
abc
xabcy
YES
1
abc

#6
abc
ababc
YES
1
abc

#7
ab*c
abc
YES
1
abc

#8
ab*bc
abc
YES
1
abc

#9
ab*bc
abbc
YES
1
abbc

#10
ab*bc
abbbbc
YES
1
abbbbc

#11
ab+bc
abbc
YES
1
abbc

#12
ab+bc
abc
NO

#13
ab+bc
abq
NO

#14
ab+bc
abbbbc
YES
1
abbbbc

#15
ab?bc
abbc
YES
1
abbc

#16
ab?bc
abc
YES
1
abc

#17
ab?bc
abbbbc
NO

#18
ab?c
abc
YES
1
abc

#19
a.c
abc
YES
1
abc

#20
a.c
axc
YES
1
axc

#21
a.*c
axyzc
YES
1
axyzc

#22
a.*c
axyzd
NO

#23
a[bc]d
abc
NO

#24
a[bc]d
abd
YES
1
abd

#25
a[b-d]e
abd
NO

#26
a[b-d]e
ace
YES
1
ace

#27
a[b-d]
aac
YES
1
ac

#28
a[b-a]
ERR

#29
a[-b]
aa
YES
1
aa

#30
a[b-]
ac
YES
1
ac

#31
a[]b
ERR

#32
a[
ERR

#33
a]
ERR

#34
a[]]
ERR

#35
a[^bc]d
aed
YES
1
aed

#36
a[^bc]
abd
NO

#37
ab|cd
abc
YES
1
ab

#38
ab|cd
abcd
YES
1
ab

#39
ab|cd
bcda
YES
1
cd

#40
a[]b
ERR

#41
()ef
ef
YES
2
ef


#42
()*
ERR

#43
*a
ERR

#44
(*)b
ERR

#45
a\
ERR

#46
a\(b
a(b
YES
1
a(b

#47
a\(*b
ab
YES
1
ab

#48
a\(*b
a((b
YES
1
a((b

#49
a\\b
a\b
YES
1
a\b

#50
abc)
ERR

#51
(abc
ERR

#52
((a))
abc
YES
3
a
a
a

#53
(a)b(c)
abc
YES
3
abc
a
c

#54
a+b+c
aabbabc
YES
1
abc

#55
a**
ERR

#56
a++
ERR

#57
a*
aaaa
YES
1
aaaa

#58
a*
baaaa
YES
1


#59
(a*)*
ERR

#60
(a*)+
ERR

#61
(a|)*
ERR

#62
(ab|cd)e
abcde
YES
2
cde
cd

#63
[abhgefdc]ij
hij
YES
1
hij

#64
ab*
xabyabbbz
YES
1
ab

#65
ab*
xayabbbz
YES
1
a

#66
abcd*efg
abcdefg
YES
1
abcdefg

#67
(ab|ab*)bc
abc
YES
2
abc
a


#68
(a|b|c|d|e)f
ef
YES
2
ef
e

#69
a|b|c|d|e
e
YES
1
e

#70
(.*)c(.*)
abcde
YES
3
abcde
ab
de

#71
\((.*), (.*)\)
(a, b)
YES
3
(a, b)
a
b

#72
a(bc)d
abcd
YES
2
abcd
bc

#73
a*
x
YES
1


#74
([abc])*d
abbbcd
YES
2
abbbcd
c

#75
a*

YES
1


#76
([abc])*bcd
abcd
YES
2
abcd
a

#77
(a|b)c*d
abcd
YES
2
bcd
b

#78
a([bc]*)c*
abc
YES
2
abc
bc

#79
[a-zA-Z_][a-zA-Z0-9_]*
alpha
YES
1
alpha

#80
((a)(b)c)(d)
abcd
YES
5
abcd
abc
a
b
d

#81
(ab|a)b*c
abc
YES
2
abc
ab

#82
a[bcd]+dcdcde
adcdcde
NO

#83
((((((((((a)))))))))
ERR

#84
(((((((((a)))))))))
a
YES
10
a
a
a
a
a
a
a
a
a
a

#85
[k]
ab
NO

#86
abcd
abcd
YES
1
abcd

#87
a[-]?c
abc
YES
1
abc

#88
multiple words of text
uh-uh
NO

#89
multiple words
multiple words, yeah
YES
1
multiple words

#90
a[bcd]*dcdcde
adcdcde
YES
1
adcdcde

#91
a([bc]*)(c*d)
abcd
YES
3
abcd
bc
d

#92
a([bc]+)(c*d)
abcd
YES
3
abcd
bc
d

#93
a([bc]*)(c+d)
abcd
YES
3
abcd
b
cd

#94
abc

NO

#95
^*
ERR

#96
$*
ERR

#97
^abc$
abc
YES
1
abc

#98
^abc$
abcc
NO

#99
^abc
abcc
YES
1
abc

#100
^abc$
aabc
NO

#101
abc$
aabc
YES
1
abc

#102
^
abc
YES
1


#103
$
abc
YES
1

#104
$b
b
NO

#105
(a+|b)*
ab
YES
2
ab
b

#106
(a+|b)+
ab
YES
2
ab
b

#107
(a+|b)?
ab
YES
2
a
a

#108
(^*
ERR

#109
)(
ERR

#110
[^ab]*
cde
YES
1
cde

#111
^(ab|cd)e
abcde
NO

#112
^a(bc+|b[eh])g|.h$
abh
YES
1
bh


#113
(bc+d$|ef*g.|h?i(j|k))
effgz
YES
2
effgz
effgz


#114
(bc+d$|ef*g.|h?i(j|k))
ij
YES
3
ij
ij
j


#115
(bc+d$|ef*g.|h?i(j|k))
effg
NO

#116
(bc+d$|ef*g.|h?i(j|k))
bcdd
NO

#117
(bc+d$|ef*g.|h?i(j|k))
reffgz
YES
2
effgz
effgz

#118
a*b\s+c
aaaab    c
YES
1
aaaab    c

#119
a*b\s+c
aaaabfc
NO

#120
a*(b*c*)
aabbcc
YES
2
aabbcc
bbcc

#121
a?b+c*
b
YES
1
b

#122
\d+
99
YES
1
99

#123
^[:javastart:]+[:javapart:]+$
javaIdentifier0
YES
1
javaIdentifier0

#124
^[:javastart:]+[:javapart:]+$
?javaIdentifier
NO

#125
[a-e]?d\\e
yyzabecd\eyyz
YES
1
cd\e

#126
((\w+)/)*(\w+)
foo/bar/baz
YES
4
foo/bar/baz
bar/
bar
baz

#127
i am a green (giant|man|martian)
i am a green man
YES
2
i am a green man
man

#128
([a-c]+?)c
abcabcabc
YES
2
abc
ab

#129
([ab]*?)b
aaaaabaaaababab
YES
2
aaaaab
aaaaa

#130
([ab]*)b
aaaaabaaaababab
YES
2
aaaaabaaaababab
aaaaabaaaababa

#131
([ab]??)b
bb
YES
2
b

#132
(c[ab]?)b
cbb
YES
2
cbb
cb

#133
(c[ab]??)b
cbb
YES
2
cb
c

#134
(c[ab]*?)b
cbb
YES
2
cb
c

#135
[:digit:]+
789
YES
1
789

#136
[:digit:]+
abc
NO

#137
[:xdigit:]+
ffe5a
YES
1
ffe5a

#138
[:wacky:]+
ERR

#139
(wee|week)(knights|knight)
weeknights
YES
3
weeknights
wee
knights

#140
(ac*)c*d[ac]*\1
acdacaa
YES
2
acdac
ac

#141
(a.*b)(a.*b)
accbaccccb
YES
3
accbaccccb
accb
accccb

#142
(.)=\1
x=x
YES
2
x=x
x

#143
([ab])=\1
a=a
YES
2
a=a
a

#144
([ab]+)=\1
abba=abba
YES
2
abba=abba
abba

#145
\u004a
J
YES
1
J

#146
\x4a
J
YES
1
J

#147
\[([:javastart:][:javapart:]*)\]
foo[bar]baz
YES
2
[bar]
bar

#148
(\s*\w+)?
  aa
YES
2
  aa
  aa

#149
(?:a)
a
YES
1
a

#150
(?:a)
aa
YES
1
a

#151
(?:\w)
abc
YES
1
a

#152
(?:\w\s\w)+
a b c
YES
1
a b

#153
(a\w)(?:,(a\w))+
ab,ac,ad
YES
3
ab,ac,ad
ab
ad

#154
z(\w\s+(?:\w\s+\w)+)z
za   b bc   cd     dz
YES
2
za   b bc   cd     dz
a   b bc   cd     d

#155
(([hH][tT]{2}[pP]|[fF][tT][pP]):\/\/)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*
http://www.test.com
YES
4
http://www.test.com
http://
http
.com

#156
((?:[hH][tT]{2}[pP]|[fF][tT][pP]):\/\/)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*
ftp://www.test.com
YES
3
ftp://www.test.com
ftp://
.com

#157
(([hH][tT]{2}[pP]|[fF][tT][pP]):\/\/)?[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*
htTp://www.test.com
YES
3
htTp://www.test.com
htTp://
htTp

#158
(?:([hH][tT]{2}[pP]|[fF][tT][pP]):\/\/)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*
FTP://www.test.com
YES
3
FTP://www.test.com
FTP
.com

#159
^(?:([hH][tT]{2}[pP]|[fF][tT][pP]):\/\/)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*$
http://.www.test.com
NO

#160
^(?:(?:[hH][tT]{2}[pP]|[fF][tT][pP]):\/\/)?[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*$
FtP://www.test.com
YES
1
FtP://www.test.com

#161
^(?:(?:[hH][tT]{2}[pP]|[fF][tT][pP]):\/\/)?[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*$
FtTP://www.test.com
NO

#162
^(?:(?:[hH][tT]{2}[pP]|[fF][tT][pP]):\/\/)?[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*$
www.test.com
YES
1
www.test.com

#163
abc.*?x+yz
abcaaaaaxyzbbbbxyz
YES
1
abcaaaaaxyz

#164
abc.+?x+yz
abcaaaaaxyzbbbbxyz
YES
1
abcaaaaaxyz

#165
a.+?(c|d)
aaaacaaaaad
YES
2
aaaac
c

#166
a.+(c|d)
aaaacaaaaad
YES
2
aaaacaaaaad
d

#167
a+?b+?c+?
aaabccaaabbbccc
YES
1
aaabc

#168
a(.+)b(.+)c(.+)d(.+)e(.+)f(.+)g(.+)h(.+)i(.+)j(.+)k(.+)l(.+)m(.+)n(.+)o(.+)p(.+)q(.+)r
a01b02c03d04e05f06g07h08i09j10k11l12m13n14o15p16q17r
YES
18
a01b02c03d04e05f06g07h08i09j10k11l12m13n14o15p16q17r
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17

#169
\bfly\b
flying
NO

#170
\bfly\b
housefly
NO

#171
[^ac]+
bd
YES
1
bd

#172
[^ca]+
bd
YES
1
bd

#173
[^ac]+
acb
YES
1
b

#174
[a-z]{0,3}
123abcdefg123
YES
1

#175
ab{0,1}a
aa
YES
1
aa

#176
ab{0,1}a
aba
YES
1
aba

#177
ab{0,1}a
abba
NO

#178
ab{0,2}a
aa
YES
1
aa

#179
ab{0,2}a
aba
YES
1
aba

#180
ab{0,2}a
abba
YES
1
abba

#181
ab{0,2}a
abbba
NO

#182
ab{1,1}a
aa
NO

#183
ab{1,1}a
aba
YES
1
aba

#184
ab{1,1}a
abba
NO

#185
ab{1,2}a
aa
NO

#186
ab{1,2}a
aba
YES
1
aba

#187
ab{1,2}a
abba
YES
1
abba

#188
ab{1,2}a
abbba
NO

#189
ab{0,}a
aa
YES
1
aa

#190
ab{0,}a
aba
YES
1
aba

#191
ab{0,}a
abba
YES
1
abba

#192
ab{1,}a
aa
NO

#193
ab{1,}a
aba
YES
1
aba

#194
ab{1,}a
abba
YES
1
abba

#195
ab{1}a
aa
NO

#196
ab{1}a
aba
YES
1
aba

#197
ab{1}a
abba
NO

#198
ab{0}a
aa
YES
1
aa

#199
ab{0}a
aba
NO

#200
ab{2}a
aa
NO

#201
ab{2}a
aba
NO

#202
ab{2}a
abba
YES
1
abba

#203
ab{2}a
abbba
NO

#204
[ \-]
-
YES
1
-

#205
[a-z0-9\.\-]+
{regexp-1.2}
YES
1
regexp-1.2

#206
[a-z0-9\-\.]+
{regexp-1.2}
YES
1
regexp-1.2

#207
[a-z\-0-9\.]+
{regexp-1.2}
YES
1
regexp-1.2

#208
\w+
a_b
YES
1
a_b

#209
([0123])??((((1st)|(2nd))|(3rd))|(\dth))
1st
YES
6
1st
null
1st
1st
1st
1st

#210
[^\s\]'<>(),;:\.\[]
-
YES
1
-

#211
^\(?(\d{3})\)?[\- ]?(\d{3})[\- ]?(\d{4})$
(425) 576+1202
NO

#212
[^\s\(\)<>@,;:\\\"\.\[\]]
-
YES
1
-

#213
a{0,1}b{0,1}c{0,1}d{0,1}e{0,1}f{0,1}g{0,1}h{0,1}i{0,1}j{0,1}k{0,1}l{0,1}
acghij
YES
1
acghij

#214
[^02468ACEGIKMOQSUW]
012
YES
1
1

#215
[^02468ACEGIKMOQSUW]
UVW
YES
1
V

#216
UUID=(\w{8}\.){3}\w{8}
UUID=3babc217.0007d4e1.74726163.006e616d
YES
4
UUID=3babc217.0007d4e1.74726163.006e616d
3babc217.
0007d4e1.
74726163.

#217
^\d{4}(-\d{2}){2}$
2004-01-01
YES
3
2004-01-01
-01
-01

#218
[\W]
a
NO

#219
[\W]
1
NO

#220
[\W]
!
YES
1
!

#221
[^\W]
a
YES
1
a

#222
[^\W]
_
YES
1
_

#223
[\D\S]+
@0 1	_1AByz
YES
1
@0 1	_1AByz

#224
[^\D\S]
@0 1	_1AByz
NO

#225
^(a{1}){0,2}$
aa
YES
3
aa
a
a

#226
(a{1,3}b){1,3}
abaabaaab
YES
4
abaabaaab
ab
aab
aaab

#227
^(1_*)??_$
1__
YES
2
1__
1_

#228
^(1_*)*?_$
1__
YES
2
1__
1_

#229
^(1_*)+?_$
1__
YES
2
1__
1_

#230
a+?b+?c+?a
aaabccaaabbbccc
YES
1
aaabcca

#231
^a{1,35}$
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
NO
