10 ab*bc abbbbc y $& abbbbc
12 .{3,4} abbbbc y $& abbb
13 ab{0,}bc abbbbc y $& abbbbc
18 ab+bc abbbbc y $& abbbbc
19 ab{1,}bc abbbbc y $& abbbbc
20 ab{1,3}bc abbbbc y $& abbbbc
21 ab{3,4}bc abbbbc y $& abbbbc
22 ab{4,5}bc abbbbc n - -
25 ab{0,1}bc abc y $& abc
48 a[b-a] - c - /a[b-a]/: invalid [] range in regexp
49 a[]b - c - /a[]b/: unmatched [] in regexp
50 a[ - c - /a[/: unmatched [] in regexp
98 *a - c - /*a/: ?+*{} follows nothing in regexp
99 (*)b - c - /(*)b/: ?+*{} follows nothing in regexp
101 a\ - c - Search pattern not terminated
102 a\(b a(b y $&-$1 a(b-
106 abc) - c - /abc)/: unmatched () in regexp
107 (abc - c - /(abc/: unmatched () in regexp
108 ((a)) abc y $&-$1-$2 a-a-a
109 (a)b(c) abc y $&-$1-$2 abc-a-c
110 a+b+c aabbabc y $& abc
111 a{1,}b{1,}c aabbabc y $& abc
112 a** - c - /a**/: nested *?+ in regexp
113 a.+?c abcabc y $& abc
114 (a+|b)* ab y $&-$1 ab-b
115 (a+|b){0,} ab y $&-$1 ab-b
116 (a+|b)+ ab y $&-$1 ab-b
117 (a+|b){1,} ab y $&-$1 ab-b
118 (a+|b)? ab y $&-$1 a-a
119 (a+|b){0,1} ab y $&-$1 a-a
120 )( - c - /)(/: unmatched () in regexp
124 ([abc])*d abbbcd y $&-$1 abbbcd-c
125 ([abc])*bcd abcd y $&-$1 abcd-a
127 (a|b|c|d|e)f ef y $&-$1 ef-e
128 abcd*efg abcdefg y $& abcdefg
129 ab* xabyabbbz y $& ab
131 (ab|cd)e abcde y $&-$1 cde-cd
132 [abhgefdc]ij hij y $& hij
133 ^(ab|cd)e abcde n x$1y xy
134 (abc|)ef abcdef y $&-$1 ef-
135 (a|b)c*d abcd y $&-$1 bcd-b
136 (ab|ab*)bc abc y $&-$1 abc-a
137 a([bc]*)c* abc y $&-$1 abc-bc
138 a([bc]*)(c*d) abcd y $&-$1-$2 abcd-bc-d
139 a([bc]+)(c*d) abcd y $&-$1-$2 abcd-bc-d
140 a([bc]*)(c+d) abcd y $&-$1-$2 abcd-b-cd
141 a[bcd]*dcdcde adcdcde y $& adcdcde
142 a[bcd]+dcdcde adcdcde n - -
143 (ab|a)b*c abc y $&-$1 abc-ab
144 ((a)(b)c)(d) abcd y $1-$2-$3-$4 abc-a-b-d
145 [a-zA-Z_][a-zA-Z0-9_]* alpha y $& alpha
146 ^a(bc+|b[eh])g|.h$ abh y $&-$1 bh-
147 (bc+d$|ef*g.|h?i(j|k)) effgz y $&-$1-$2 effgz-effgz-
148 (bc+d$|ef*g.|h?i(j|k)) ij y $&-$1-$2 ij-ij-j
149 (bc+d$|ef*g.|h?i(j|k)) effg n - -
150 (bc+d$|ef*g.|h?i(j|k)) bcdd n - -
151 (bc+d$|ef*g.|h?i(j|k)) reffgz y $&-$1-$2 effgz-effgz-
152 ((((((((((a)))))))))) a y $10 a
153 ((((((((((a))))))))))\10 aa y $& aa
154 ((((((((((a))))))))))\41 aa n - -
155 ((((((((((a))))))))))\41 a! y $& a!
156 (((((((((a))))))))) a y $& a
157 multiple words of text uh-uh n - -
158 multiple words multiple words, yeah y $& multiple words
159 (.*)c(.*) abcde y $&-$1-$2 abcde-ab-de
160 \((.*), (.*)\) (a, b) y ($2, $1) (b, a)
162 abcd abcd y $&-\$&-\\$& abcd-$&-\abcd
163 a(bc)d abcd y $1-\$1-\\$1 bc-$1-\bc
165 (abc)\1 abcabc y $1 abc
166 ([a-c]*)\1 abcabc y $1 abc
171 'abc'i XABCY y $& ABC
172 'abc'i ABABC y $& ABC
174 'ab*bc'i ABC y $& ABC
175 'ab*bc'i ABBC y $& ABBC
176 'ab*?bc'i ABBBBC y $& ABBBBC
177 'ab{0,}?bc'i ABBBBC y $& ABBBBC
178 'ab+?bc'i ABBC y $& ABBC
181 'ab{1,}bc'i ABQ n - -
182 'ab+bc'i ABBBBC y $& ABBBBC
183 'ab{1,}?bc'i ABBBBC y $& ABBBBC
184 'ab{1,3}?bc'i ABBBBC y $& ABBBBC
185 'ab{3,4}?bc'i ABBBBC y $& ABBBBC
186 'ab{4,5}?bc'i ABBBBC n - -
187 'ab??bc'i ABBC y $& ABBC
188 'ab??bc'i ABC y $& ABC
189 'ab{0,1}?bc'i ABC y $& ABC
190 'ab??bc'i ABBBBC n - -
191 'ab??c'i ABC y $& ABC
192 'ab{0,1}?c'i ABC y $& ABC
193 '^abc$'i ABC y $& ABC
195 '^abc'i ABCC y $& ABC
197 'abc$'i AABC y $& ABC
202 'a.*?c'i AXYZC y $& AXYZC
205 'a[bc]d'i ABD y $& ABD
207 'a[b-d]e'i ACE y $& ACE
208 'a[b-d]'i AAC y $& AC
211 'a[b-a]'i - c - /a[b-a]/: invalid [] range in regexp
212 'a[]b'i - c - /a[]b/: unmatched [] in regexp
213 'a['i - c - /a[/: unmatched [] in regexp
215 'a[]]b'i A]B y $& A]B
216 'a[^bc]d'i AED y $& AED
218 'a[^-b]c'i ADC y $& ADC
221 'a[^]b]c'i ADC y $& ADC
223 'ab|cd'i ABCD y $& AB
224 '()ef'i DEF y $&-$1 EF-
225 '*a'i - c - /*a/: ?+*{} follows nothing in regexp
226 '(*)b'i - c - /(*)b/: ?+*{} follows nothing in regexp
228 'a\'i - c - Search pattern not terminated
229 'a\(b'i A(B y $&-$1 A(B-
231 'a\(*b'i A((B y $& A((B
233 'abc)'i - c - /abc)/: unmatched () in regexp
234 '(abc'i - c - /(abc/: unmatched () in regexp
235 '((a))'i ABC y $&-$1-$2 A-A-A
236 '(a)b(c)'i ABC y $&-$1-$2 ABC-A-C
237 'a+b+c'i AABBABC y $& ABC
238 'a{1,}b{1,}c'i AABBABC y $& ABC
239 'a**'i - c - /a**/: nested *?+ in regexp
240 'a.+?c'i ABCABC y $& ABC
241 'a.*?c'i ABCABC y $& ABC
242 'a.{0,5}?c'i ABCABC y $& ABC
243 '(a+|b)*'i AB y $&-$1 AB-B
244 '(a+|b){0,}'i AB y $&-$1 AB-B
245 '(a+|b)+'i AB y $&-$1 AB-B
246 '(a+|b){1,}'i AB y $&-$1 AB-B
247 '(a+|b)?'i AB y $&-$1 A-A
248 '(a+|b){0,1}'i AB y $&-$1 A-A
249 '(a+|b){0,1}?'i AB y $&-$1 -
250 ')('i - c - /)(/: unmatched () in regexp
251 '[^ab]*'i CDE y $& CDE
254 '([abc])*d'i ABBBCD y $&-$1 ABBBCD-C
255 '([abc])*bcd'i ABCD y $&-$1 ABCD-A
256 'a|b|c|d|e'i E y $& E
257 '(a|b|c|d|e)f'i EF y $&-$1 EF-E
258 'abcd*efg'i ABCDEFG y $& ABCDEFG
259 'ab*'i XABYABBBZ y $& AB
260 'ab*'i XAYABBBZ y $& A
261 '(ab|cd)e'i ABCDE y $&-$1 CDE-CD
262 '[abhgefdc]ij'i HIJ y $& HIJ
263 '^(ab|cd)e'i ABCDE n x$1y XY
264 '(abc|)ef'i ABCDEF y $&-$1 EF-
265 '(a|b)c*d'i ABCD y $&-$1 BCD-B
266 '(ab|ab*)bc'i ABC y $&-$1 ABC-A
267 'a([bc]*)c*'i ABC y $&-$1 ABC-BC
268 'a([bc]*)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
269 'a([bc]+)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
270 'a([bc]*)(c+d)'i ABCD y $&-$1-$2 ABCD-B-CD
271 'a[bcd]*dcdcde'i ADCDCDE y $& ADCDCDE
272 'a[bcd]+dcdcde'i ADCDCDE n - -
273 '(ab|a)b*c'i ABC y $&-$1 ABC-AB
274 '((a)(b)c)(d)'i ABCD y $1-$2-$3-$4 ABC-A-B-D
275 '[a-zA-Z_][a-zA-Z0-9_]*'i ALPHA y $& ALPHA
276 '^a(bc+|b[eh])g|.h$'i ABH y $&-$1 BH-
277 '(bc+d$|ef*g.|h?i(j|k))'i EFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
278 '(bc+d$|ef*g.|h?i(j|k))'i IJ y $&-$1-$2 IJ-IJ-J
279 '(bc+d$|ef*g.|h?i(j|k))'i EFFG n - -
280 '(bc+d$|ef*g.|h?i(j|k))'i BCDD n - -
281 '(bc+d$|ef*g.|h?i(j|k))'i REFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
282 '((((((((((a))))))))))'i A y $10 A
283 '((((((((((a))))))))))\10'i AA y $& AA
284 '((((((((((a))))))))))\41'i AA n - -
285 '((((((((((a))))))))))\41'i A! y $& A!
286 '(((((((((a)))))))))'i A y $& A
287 '(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))'i A y $1 A
288 '(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))'i C y $1 C
289 'multiple words of text'i UH-UH n - -
290 'multiple words'i MULTIPLE WORDS, YEAH y $& MULTIPLE WORDS
291 '(.*)c(.*)'i ABCDE y $&-$1-$2 ABCDE-AB-DE
292 '\((.*), (.*)\)'i (A, B) y ($2, $1) (B, A)
294 'abcd'i ABCD y $&-\$&-\\$& ABCD-$&-\ABCD
295 'a(bc)d'i ABCD y $1-\$1-\\$1 BC-$1-\BC
297 '(abc)\1'i ABCABC y $1 ABC
298 '([a-c]*)\1'i ABCABC y $1 ABC
301 a(?=c|d). abad y $& ad
302 a(?:b|c|d)(.) ace y $1 e
303 a(?:b|c|d)*(.) ace y $1 e
304 a(?:b|c|d)+?(.) ace y $1 e
305 a(?:b|c|d)+?(.) acdbcdbe y $1 d
306 a(?:b|c|d)+(.) acdbcdbe y $1 e
307 a(?:b|c|d){2}(.) acdbcdbe y $1 b
308 a(?:b|c|d){4,5}(.) acdbcdbe y $1 b
309 a(?:b|c|d){4,5}?(.) acdbcdbe y $1 d
310 ((foo)|(bar))* foobar y $1-$2-$3 bar-foo-bar
311 :(?: - c - /(?/: Sequence (? incomplete
312 a(?:b|c|d){6,7}(.) acdbcdbe y $1 e
313 a(?:b|c|d){6,7}?(.) acdbcdbe y $1 e
314 a(?:b|c|d){5,6}(.) acdbcdbe y $1 e
315 a(?:b|c|d){5,6}?(.) acdbcdbe y $1 b
316 a(?:b|c|d){5,7}(.) acdbcdbe y $1 e
317 a(?:b|c|d){5,7}?(.) acdbcdbe y $1 b
318 a(?:b|(c|e){1,2}?|d)+?(.) ace y $1$2 ce
320 ^([^a-z])|(\^)$ . y $1 .
322 ^(a\1?){4}$ aaaaaaaaaa y $1 aaaa
323 ^(a\1?){4}$ aaaaaaaaa n - -
324 ^(a\1?){4}$ aaaaaaaaaaa n - -
325 ^(a(?(1)\1)){4}$ aaaaaaaaaa y $1 aaaa
326 ^(a(?(1)\1)){4}$ aaaaaaaaa n - -
327 ^(a(?(1)\1)){4}$ aaaaaaaaaaa n - -
328 (?:(f)(o)(o)|(b)(a)(r))* foobar y $1:$2:$3:$4:$5:$6 f:o:o:b:a:r
336 (?<%)b - c - /(?<%)b/: Sequence (?%...) not recognized
337 (?:..)*a aba y $& aba
339 ^(?:b|a(?=(.)))*\1 abc y $& ab
342 ^((a|b)+)*ax aax y $1 a
343 ^((a|bc)+)*ax aax y $1 a
346 (?:(?i)a)b ab y $& ab
347 ((?i)a)b ab y $&:$1 ab:a
348 (?:(?i)a)b Ab y $& Ab
349 ((?i)a)b Ab y $&:$1 Ab:A
352 (?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b))) cabbbb y $& cabbbb
353 (?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb))) caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb y $& caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
354 '(ab)\d\1'i Ab4ab y $1 Ab
355 '(ab)\d\1'i ab4Ab y $1 ab
356 foo\w*\d{4}baz foobar1234baz y $& foobar1234baz
357 a{1,32766} aaa y $& aaa
358 a{1,32767} - c - /a{1,32767}/: Quantifier in {,} bigger than
359 a{1,32768} - c - /a{1,32768}/: Quantifier in {,} bigger than
361 a(?{)b - c - /a(?{)b/: Sequence (?{...}) not terminated or not {}-balanced
362 a(?{{})b - c - /a(?{{})b/: Sequence (?{...}) not terminated or not {}-balanced
363 a(?{}})b - c - /a(?{}})b/: Sequence (?{...}) not terminated or not {}-balanced
364 a(?{"{"})b - c - /a(?{"{"})b/: Sequence (?{...}) not terminated or not {}-balanced
365 a(?{"\{"})b cabd y $& ab
366 a(?{"{"}})b - c - Unmatched right bracket
367 a(?{$bl="\{"}).b caxbd y $bl {
368 x(~~)*(?:(?:F)?)? x~~ y - -
369 ^a(?#xxx){3}c aaac y $& aaac
370 '^a (?#xxx) (?#yyy) {3}c'x aaac y $& aaac
371 (?<![cd])b dbcb n - -
372 (?<![cd])[ab] dbaacb y $& a
373 (?<!(c|d))b dbcb n - -
374 (?<!(c|d))[ab] dbaacb y $& a
375 (?<!cd)[ab] cdaccb y $& b
376 ^(?:a?b?)*$ a-- n - -
377 ((?s)^a(.))((?m)^b$) a\nb\nc\n y $1;$2;$3 a\n;\n;b
378 ((?m)^b$) a\nb\nc\n y $1 b
380 (?m)^(b) a\nb\n y $1 b
381 ((?m)^b) a\nb\n y $1 b
382 \n((?m)^b) a\nb\n y $1 b
383 ((?s).)c(?!.) a\nb\nc\n y $1 \n
384 ((?s).)c(?!.) a\nb\nc\n y $1:$& \n:\nc
385 ((?s)b.)c(?!.) a\nb\nc\n y $1 b\n
386 ((?s)b.)c(?!.) a\nb\nc\n y $1:$& b\n:b\nc
389 ((?m)^b) a\nb\nc\n y $1 b
392 (x)?(?(1)a|b) a n - -
393 (x)?(?(1)b|a) a y $& a
394 ()?(?(1)b|a) a y $& a
396 ()?(?(1)a|b) a y $& a
397 ^(\()?blah(?(1)(\)))$ (blah) y $2 )
398 ^(\()?blah(?(1)(\)))$ blah y ($2) ()
399 ^(\()?blah(?(1)(\)))$ blah) n - -
400 ^(\()?blah(?(1)(\)))$ (blah n - -
401 ^(\(+)?blah(?(1)(\)))$ (blah) y $2 )
402 ^(\(+)?blah(?(1)(\)))$ blah y ($2) ()
403 ^(\(+)?blah(?(1)(\)))$ blah) n - -
404 ^(\(+)?blah(?(1)(\)))$ (blah n - -
405 (?(1?)a|b) a c - /(?(1?)a|b)/: Switch (?(number? not recognized
406 (?(1)a|b|c) a c - /(?(1)a|b|c)/: Switch (?(condition)... contains too many branches
408 (?(?{0})b|a) a y $& a
410 (?(?{1})a|b) a y $& a
415 (?=(a+?))(\1ab) aaab y $2 aab
416 ^(?=(a+?))\1ab aaab n - -
417 (\w+:)+ one: y $1 one:
419 (?=(a+?))(\1ab) aaab y $2 aab
420 ^(?=(a+?))\1ab aaab n - -
421 ([\w:]+::)?(\w+)$ abcd: n - -
422 ([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
423 ([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
424 ^[^bcd]*(c+) aexycd y $1 c
426 ([\w:]+::)?(\w+)$ abcd: n - -
427 ([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
428 ([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
429 ^[^bcd]*(c+) aexycd y $1 c
430 (?{$a=2})a*aa(?{local$a=$a+1})k*c(?{$b=$a}) yaaxxaaaacd y $b 3
431 (?{$a=2})(a(?{local$a=$a+1}))*aak*c(?{$b=$a}) yaaxxaaaacd y $b 4
434 ([[:]+) a:[b]: y $1 :[
435 ([[=]+) a=[b]= y $1 =[
436 ([[.]+) a.[b]. y $1 .[
437 [a[:xyz: - c - /[a[:xyz:/: unmatched [] in regexp
438 [a[:xyz:] - c - /[a[:xyz:]/: unmatched [] in regexp
439 ([a[:xyz:]b]+) pbaq y $1 ba
440 ((?>a+)b) aaab y $1 aaab
441 (?>(a+))b aaab y $1 aaa
442 ((?>[^()]+)|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x