1;
2;
3; this file contains a script of tests to run through regress.exe
4;
5; comments start with a semicolon and proceed to the end of the line
6;
7; changes to regular expression compile flags start with a "-" as the first
8; non-whitespace character and consist of a list of the printable names
9; of the flags, for example "match_default"
10;
11; Other lines contain a test to perform using the current flag status
12; the first token contains the expression to compile, the second the string
13; to match it against. If the second string is "!" then the expression should
14; not compile, that is the first string is an invalid regular expression.
15; This is then followed by a list of integers that specify what should match,
16; each pair represents the starting and ending positions of a subexpression
17; starting with the zeroth subexpression (the whole match).
18; A value of -1 indicates that the subexpression should not take part in the
19; match at all, if the first value is -1 then no part of the expression should
20; match the string.
21;
22; Tests taken from BOOST testsuite and adapted to glibc regex.
23;
24; Boost Software License - Version 1.0 - August 17th, 2003
25;
26; Permission is hereby granted, free of charge, to any person or organization
27; obtaining a copy of the software and accompanying documentation covered by
28; this license (the "Software") to use, reproduce, display, distribute,
29; execute, and transmit the Software, and to prepare derivative works of the
30; Software, and to permit third-parties to whom the Software is furnished to
31; do so, all subject to the following:
32;
33; The copyright notices in the Software and this entire statement, including
34; the above license grant, this restriction and the following disclaimer,
35; must be included in all copies of the Software, in whole or in part, and
36; all derivative works of the Software, unless such copies or derivative
37; works are solely in the form of machine-executable object code generated by
38; a source language processor.
39;
40; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42; FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
43; SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
44; FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
45; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
46; DEALINGS IN THE SOFTWARE.
47;
48
49- match_default normal REG_EXTENDED
50
51;
52; try some really simple literals:
53a a 0 1
54Z Z 0 1
55Z aaa -1 -1
56Z xxxxZZxxx 4 5
57
58; and some simple brackets:
59(a) zzzaazz 3 4 3 4
60() zzz 0 0 0 0
61() "" 0 0 0 0
62( !
63) ) 0 1
64(aa !
65aa) baa)b 1 4
66a b -1 -1
67\(\) () 0 2
68\(a\) (a) 0 3
69\() () 0 2
70(\) !
71p(a)rameter ABCparameterXYZ 3 12 4 5
72[pq](a)rameter ABCparameterXYZ 3 12 4 5
73
74; now try escaped brackets:
75- match_default bk_parens REG_BASIC
76\(a\) zzzaazz 3 4 3 4
77\(\) zzz 0 0 0 0
78\(\) "" 0 0 0 0
79\( !
80\) !
81\(aa !
82aa\) !
83() () 0 2
84(a) (a) 0 3
85(\) !
86\() !
87
88; now move on to "." wildcards
89- match_default normal REG_EXTENDED REG_STARTEND
90. a 0 1
91. \n 0 1
92. \r 0 1
93. \0 0 1
94
95;
96; now move on to the repetion ops,
97; starting with operator *
98- match_default normal REG_EXTENDED
99a* b 0 0
100ab* a 0 1
101ab* ab 0 2
102ab* sssabbbbbbsss 3 10
103ab*c* a 0 1
104ab*c* abbb 0 4
105ab*c* accc 0 4
106ab*c* abbcc 0 5
107*a !
108\<* !
109\>* !
110\n* \n\n 0 2
111\** ** 0 2
112\* * 0 1
113
114; now try operator +
115ab+ a -1 -1
116ab+ ab 0 2
117ab+ sssabbbbbbsss 3 10
118ab+c+ a -1 -1
119ab+c+ abbb -1 -1
120ab+c+ accc -1 -1
121ab+c+ abbcc 0 5
122+a !
123\<+ !
124\>+ !
125\n+ \n\n 0 2
126\+ + 0 1
127\+ ++ 0 1
128\++ ++ 0 2
129
130; now try operator ?
131- match_default normal REG_EXTENDED
132a? b 0 0
133ab? a 0 1
134ab? ab 0 2
135ab? sssabbbbbbsss 3 5
136ab?c? a 0 1
137ab?c? abbb 0 2
138ab?c? accc 0 2
139ab?c? abcc 0 3
140?a !
141\<? !
142\>? !
143\n? \n\n 0 1
144\? ? 0 1
145\? ?? 0 1
146\?? ?? 0 1
147
148; now try operator {}
149- match_default normal REG_EXTENDED
150a{2} a -1 -1
151a{2} aa 0 2
152a{2} aaa 0 2
153a{2,} a -1 -1
154a{2,} aa 0 2
155a{2,} aaaaa 0 5
156a{2,4} a -1 -1
157a{2,4} aa 0 2
158a{2,4} aaa 0 3
159a{2,4} aaaa 0 4
160a{2,4} aaaaa 0 4
161a{} !
162a{2 !
163a} a} 0 2
164\{\} {} 0 2
165
166- match_default normal REG_BASIC
167a\{2\} a -1 -1
168a\{2\} aa 0 2
169a\{2\} aaa 0 2
170a\{2,\} a -1 -1
171a\{2,\} aa 0 2
172a\{2,\} aaaaa 0 5
173a\{2,4\} a -1 -1
174a\{2,4\} aa 0 2
175a\{2,4\} aaa 0 3
176a\{2,4\} aaaa 0 4
177a\{2,4\} aaaaa 0 4
178{} {} 0 2
179
180; now test the alternation operator |
181- match_default normal REG_EXTENDED
182a|b a 0 1
183a|b b 0 1
184a(b|c) ab 0 2 1 2
185a(b|c) ac 0 2 1 2
186a(b|c) ad -1 -1 -1 -1
187a\| a| 0 2
188
189; now test the set operator []
190- match_default normal REG_EXTENDED
191; try some literals first
192[abc] a 0 1
193[abc] b 0 1
194[abc] c 0 1
195[abc] d -1 -1
196[^bcd] a 0 1
197[^bcd] b -1 -1
198[^bcd] d -1 -1
199[^bcd] e 0 1
200a[b]c abc 0 3
201a[ab]c abc 0 3
202a[^ab]c adc 0 3
203a[]b]c a]c 0 3
204a[[b]c a[c 0 3
205a[-b]c a-c 0 3
206a[^]b]c adc 0 3
207a[^-b]c adc 0 3
208a[b-]c a-c 0 3
209a[b !
210a[] !
211
212; then some ranges
213[b-e] a -1 -1
214[b-e] b 0 1
215[b-e] e 0 1
216[b-e] f -1 -1
217[^b-e] a 0 1
218[^b-e] b -1 -1
219[^b-e] e -1 -1
220[^b-e] f 0 1
221a[1-3]c a2c 0 3
222a[3-1]c !
223a[1-3-5]c !
224a[1- !
225
226; and some classes
227a[[:alpha:]]c abc 0 3
228a[[:unknown:]]c !
229a[[: !
230a[[:alpha !
231a[[:alpha:] !
232a[[:alpha,:] !
233a[[:]:]]b !
234a[[:-:]]b !
235a[[:alph:]] !
236a[[:alphabet:]] !
237[[:alnum:]]+ -%@a0X_- 3 6
238[[:alpha:]]+ -%@aX_0- 3 5
239[[:blank:]]+ "a  \tb" 1 4
240[[:cntrl:]]+ a\n\tb 1 3
241[[:digit:]]+ a019b 1 4
242[[:graph:]]+ " a%b " 1 4
243[[:lower:]]+ AabC 1 3
244; This test fails with STLPort, disable for now as this is a corner case anyway...
245;[[:print:]]+ "\na b\n" 1 4
246[[:punct:]]+ " %-&\t" 1 4
247[[:space:]]+ "a \n\t\rb" 1 5
248[[:upper:]]+ aBCd 1 3
249[[:xdigit:]]+ p0f3Cx 1 5
250
251; now test flag settings:
252- escape_in_lists REG_NO_POSIX_TEST
253[\n] \n 0 1
254- REG_NO_POSIX_TEST
255
256; line anchors
257- match_default normal REG_EXTENDED
258^ab ab 0 2
259^ab xxabxx -1 -1
260ab$ ab 0 2
261ab$ abxx -1 -1
262- match_default match_not_bol match_not_eol normal REG_EXTENDED REG_NOTBOL REG_NOTEOL
263^ab ab -1 -1
264^ab xxabxx -1 -1
265ab$ ab -1 -1
266ab$ abxx -1 -1
267
268; back references
269- match_default normal REG_PERL
270a(b)\2c	!
271a(b\1)c	!
272a(b*)c\1d abbcbbd 0 7 1 3
273a(b*)c\1d abbcbd -1 -1
274a(b*)c\1d abbcbbbd -1 -1
275^(.)\1 abc -1 -1
276a([bc])\1d abcdabbd	4 8 5 6
277; strictly speaking this is at best ambiguous, at worst wrong, this is what most
278; re implimentations will match though.
279a(([bc])\2)*d abbccd 0 6 3 5 3 4
280
281a(([bc])\2)*d abbcbd -1 -1
282a((b)*\2)*d abbbd 0 5 1 4 2 3
283; perl only:
284(ab*)[ab]*\1 ababaaa 0 7 0 1
285(a)\1bcd aabcd 0 5 0 1
286(a)\1bc*d aabcd 0 5 0 1
287(a)\1bc*d aabd 0 4 0 1
288(a)\1bc*d aabcccd 0 7 0 1
289(a)\1bc*[ce]d aabcccd 0 7 0 1
290^(a)\1b(c)*cd$ aabcccd 0 7 0 1 4 5
291
292; posix only:
293- match_default extended REG_EXTENDED
294(ab*)[ab]*\1 ababaaa 0 7 0 1
295
296;
297; word operators:
298\w a 0 1
299\w z 0 1
300\w A 0 1
301\w Z 0 1
302\w _ 0 1
303\w } -1 -1
304\w ` -1 -1
305\w [ -1 -1
306\w @ -1 -1
307; non-word:
308\W a -1 -1
309\W z -1 -1
310\W A -1 -1
311\W Z -1 -1
312\W _ -1 -1
313\W } 0 1
314\W ` 0 1
315\W [ 0 1
316\W @ 0 1
317; word start:
318\<abcd "  abcd" 2 6
319\<ab cab -1 -1
320\<ab "\nab" 1 3
321\<tag ::tag 2 5
322;word end:
323abc\> abc 0 3
324abc\> abcd -1 -1
325abc\> abc\n 0 3
326abc\> abc:: 0 3
327; word boundary:
328\babcd "  abcd" 2 6
329\bab cab -1 -1
330\bab "\nab" 1 3
331\btag ::tag 2 5
332abc\b abc 0 3
333abc\b abcd -1 -1
334abc\b abc\n 0 3
335abc\b abc:: 0 3
336; within word:
337\B ab 1 1
338a\Bb ab 0 2
339a\B ab 0 1
340a\B a -1 -1
341a\B "a " -1 -1
342
343;
344; buffer operators:
345\`abc abc 0 3
346\`abc \nabc -1 -1
347\`abc " abc" -1 -1
348abc\' abc 0 3
349abc\' abc\n -1 -1
350abc\' "abc " -1 -1
351
352;
353; now follows various complex expressions designed to try and bust the matcher:
354a(((b)))c abc 0 3 1 2 1 2 1 2
355a(b|(c))d abd 0 3 1 2 -1 -1
356a(b|(c))d acd 0 3 1 2 1 2
357a(b*|c)d abbd 0 4 1 3
358; just gotta have one DFA-buster, of course
359a[ab]{20} aaaaabaaaabaaaabaaaab 0 21
360; and an inline expansion in case somebody gets tricky
361a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab] aaaaabaaaabaaaabaaaab 0 21
362; and in case somebody just slips in an NFA...
363a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night) aaaaabaaaabaaaabaaaabweeknights 0 31 21 24 24 31
364; one really big one
3651234567890123456789012345678901234567890123456789012345678901234567890 a1234567890123456789012345678901234567890123456789012345678901234567890b 1 71
366; fish for problems as brackets go past 8
367[ab][cd][ef][gh][ij][kl][mn] xacegikmoq 1 8
368[ab][cd][ef][gh][ij][kl][mn][op] xacegikmoq 1 9
369[ab][cd][ef][gh][ij][kl][mn][op][qr] xacegikmoqy 1 10
370[ab][cd][ef][gh][ij][kl][mn][op][q] xacegikmoqy 1 10
371; and as parenthesis go past 9:
372(a)(b)(c)(d)(e)(f)(g)(h) zabcdefghi 1 9 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9
373(a)(b)(c)(d)(e)(f)(g)(h)(i) zabcdefghij 1 10 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10
374(a)(b)(c)(d)(e)(f)(g)(h)(i)(j) zabcdefghijk 1 11 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11
375(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k) zabcdefghijkl 1 12 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12
376(a)d|(b)c abc 1 3 -1 -1 1 2
377_+((www)|(ftp)|(mailto)):_* "_wwwnocolon _mailto:" 12 20 13 19 -1 -1 -1 -1 13 19
378
379; subtleties of matching
380;a(b)?c\1d acd 0 3 -1 -1
381; POSIX is about the following test:
382a(b)?c\1d acd -1 -1 -1 -1
383a(b?c)+d accd 0 4 2 3
384(wee|week)(knights|night) weeknights 0 10 0 3 3 10
385.* abc 0 3
386a(b|(c))d abd 0 3 1 2 -1 -1
387a(b|(c))d acd 0 3 1 2 1 2
388a(b*|c|e)d abbd 0 4 1 3
389a(b*|c|e)d acd 0 3 1 2
390a(b*|c|e)d ad 0 2 1 1
391a(b?)c abc 0 3 1 2
392a(b?)c ac 0 2 1 1
393a(b+)c abc 0 3 1 2
394a(b+)c abbbc 0 5 1 4
395a(b*)c ac 0 2 1 1
396(a|ab)(bc([de]+)f|cde) abcdef 0 6 0 1 1 6 3 5
397a([bc]?)c abc 0 3 1 2
398a([bc]?)c ac 0 2 1 1
399a([bc]+)c abc 0 3 1 2
400a([bc]+)c abcc 0 4 1 3
401a([bc]+)bc abcbc 0 5 1 3
402a(bb+|b)b abb 0 3 1 2
403a(bbb+|bb+|b)b abb 0 3 1 2
404a(bbb+|bb+|b)b abbb 0 4 1 3
405a(bbb+|bb+|b)bb abbb 0 4 1 2
406(.*).* abcdef 0 6 0 6
407(a*)* bc 0 0 0 0
408xyx*xz xyxxxxyxxxz 5 11
409
410; do we get the right subexpression when it is used more than once?
411a(b|c)*d ad 0 2 -1 -1
412a(b|c)*d abcd 0 4 2 3
413a(b|c)+d abd 0 3 1 2
414a(b|c)+d abcd 0 4 2 3
415a(b|c?)+d ad 0 2 1 1
416a(b|c){0,0}d ad 0 2 -1 -1
417a(b|c){0,1}d ad 0 2 -1 -1
418a(b|c){0,1}d abd 0 3 1 2
419a(b|c){0,2}d ad 0 2 -1 -1
420a(b|c){0,2}d abcd 0 4 2 3
421a(b|c){0,}d ad 0 2 -1 -1
422a(b|c){0,}d abcd 0 4 2 3
423a(b|c){1,1}d abd 0 3 1 2
424a(b|c){1,2}d abd 0 3 1 2
425a(b|c){1,2}d abcd 0 4 2 3
426a(b|c){1,}d abd 0 3 1 2
427a(b|c){1,}d abcd 0 4 2 3
428a(b|c){2,2}d acbd 0 4 2 3
429a(b|c){2,2}d abcd 0 4 2 3
430a(b|c){2,4}d abcd 0 4 2 3
431a(b|c){2,4}d abcbd 0 5 3 4
432a(b|c){2,4}d abcbcd 0 6 4 5
433a(b|c){2,}d abcd 0 4 2 3
434a(b|c){2,}d abcbd 0 5 3 4
435; perl only: these conflict with the POSIX test below
436;a(b|c?)+d abcd 0 4 3 3
437;a(b+|((c)*))+d abd 0 3 2 2 2 2 -1 -1
438;a(b+|((c)*))+d abcd 0 4 3 3 3 3 2 3
439
440; posix only:
441- match_default extended REG_EXTENDED REG_STARTEND
442
443a(b|c?)+d abcd 0 4 2 3
444a(b|((c)*))+d abcd 0 4 2 3 2 3 2 3
445a(b+|((c)*))+d abd 0 3 1 2 -1 -1 -1 -1
446a(b+|((c)*))+d abcd 0 4 2 3 2 3 2 3
447a(b|((c)*))+d ad 0 2 1 1 1 1 -1 -1
448a(b|((c)*))*d abcd 0 4 2 3 2 3 2 3
449a(b+|((c)*))*d abd 0 3 1 2 -1 -1 -1 -1
450a(b+|((c)*))*d abcd 0 4 2 3 2 3 2 3
451a(b|((c)*))*d ad 0 2 1 1 1 1 -1 -1
452
453- match_default normal REG_PERL
454; try to match C++ syntax elements:
455; line comment:
456//[^\n]* "++i //here is a line comment\n" 4 28
457; block comment:
458/\*([^*]|\*+[^*/])*\*+/ "/* here is a block comment */" 0 29 26 27
459/\*([^*]|\*+[^*/])*\*+/ "/**/" 0 4 -1 -1
460/\*([^*]|\*+[^*/])*\*+/ "/***/" 0 5 -1 -1
461/\*([^*]|\*+[^*/])*\*+/ "/****/" 0 6 -1 -1
462/\*([^*]|\*+[^*/])*\*+/ "/*****/" 0 7 -1 -1
463/\*([^*]|\*+[^*/])*\*+/ "/*****/*/" 0 7 -1 -1
464; preprossor directives:
465^[[:blank:]]*#([^\n]*\\[[:space:]]+)*[^\n]* "#define some_symbol" 0 19 -1 -1
466^[[:blank:]]*#([^\n]*\\[[:space:]]+)*[^\n]* "#define some_symbol(x) #x" 0 25 -1 -1
467; perl only:
468^[[:blank:]]*#([^\n]*\\[[:space:]]+)*[^\n]* "#define some_symbol(x) \\  \r\n  foo();\\\r\n   printf(#x);" 0 53 30 42
469; literals:
470((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 0xFF         						0 4		0 4		0 4 	-1 -1 	-1 -1 	-1 -1 	-1 -1
471((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 35 									0 2 	0 2		-1 -1 	0 2 	-1 -1 	-1 -1 	-1 -1
472((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 0xFFu 								0 5		0 4		0 4 	-1 -1 	-1 -1 	-1 -1 	-1 -1
473((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 0xFFL 								0 5		0 4		0 4 	-1 -1 	4 5 	-1 -1 	-1 -1
474((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 0xFFFFFFFFFFFFFFFFuint64 			0 24	0 18	0 18 	-1 -1 	19 24 	19 24 	22 24
475; strings:
476'([^\\']|\\.)*' '\\x3A' 0 6 4 5
477'([^\\']|\\.)*' '\\'' 0 4 1 3
478'([^\\']|\\.)*' '\\n' 0 4 1 3
479
480; finally try some case insensitive matches:
481- match_default normal REG_EXTENDED REG_ICASE
482; upper and lower have no meaning here so they fail, however these
483; may compile with other libraries...
484;[[:lower:]] !
485;[[:upper:]] !
4860123456789@abcdefghijklmnopqrstuvwxyz\[\\\]\^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ\{\|\} 0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]\^_`abcdefghijklmnopqrstuvwxyz\{\|\} 0 72
487
488; known and suspected bugs:
489- match_default normal REG_EXTENDED
490\( ( 0 1
491\) ) 0 1
492\$ $ 0 1
493\^ ^ 0 1
494\. . 0 1
495\* * 0 1
496\+ + 0 1
497\? ? 0 1
498\[ [ 0 1
499\] ] 0 1
500\| | 0 1
501\\ \\ 0 1
502# # 0 1
503\# # 0 1
504a- a- 0 2
505\- - 0 1
506\{ { 0 1
507\} } 0 1
5080 0 0 1
5091 1 0 1
5109 9 0 1
511b b 0 1
512B B 0 1
513< < 0 1
514> > 0 1
515w w 0 1
516W W 0 1
517` ` 0 1
518' ' 0 1
519\n \n 0 1
520, , 0 1
521a a 0 1
522f f 0 1
523n n 0 1
524r r 0 1
525t t 0 1
526v v 0 1
527c c 0 1
528x x 0 1
529: : 0 1
530(\.[[:alnum:]]+){2} "w.a.b " 1 5 3 5
531
532- match_default normal REG_EXTENDED REG_ICASE
533a A 0 1
534A a 0 1
535[abc]+ abcABC 0 6
536[ABC]+ abcABC 0 6
537[a-z]+ abcABC 0 6
538[A-Z]+ abzANZ 0 6
539[a-Z]+ abzABZ 0 6
540[A-z]+ abzABZ 0 6
541[[:lower:]]+ abyzABYZ 0 8
542[[:upper:]]+ abzABZ 0 6
543[[:alpha:]]+ abyzABYZ 0 8
544[[:alnum:]]+ 09abyzABYZ 0 10
545
546; word start:
547\<abcd "  abcd" 2 6
548\<ab cab -1 -1
549\<ab "\nab" 1 3
550\<tag ::tag 2 5
551;word end:
552abc\> abc 0 3
553abc\> abcd -1 -1
554abc\> abc\n 0 3
555abc\> abc:: 0 3
556
557; collating elements and rewritten set code:
558- match_default normal REG_EXTENDED REG_STARTEND
559;[[.zero.]] 0 0 1
560;[[.one.]] 1 0 1
561;[[.two.]] 2 0 1
562;[[.three.]] 3 0 1
563[[.a.]] baa 1 2
564;[[.right-curly-bracket.]] } 0 1
565;[[.NUL.]] \0 0 1
566[[:<:]z] !
567[a[:>:]] !
568[[=a=]] a 0 1
569;[[=right-curly-bracket=]] } 0 1
570- match_default normal REG_EXTENDED REG_STARTEND REG_ICASE
571[[.A.]] A 0 1
572[[.A.]] a 0 1
573[[.A.]-b]+ AaBb 0 4
574[A-[.b.]]+ AaBb 0 4
575[[.a.]-B]+ AaBb 0 4
576[a-[.B.]]+ AaBb 0 4
577- match_default normal REG_EXTENDED REG_STARTEND
578[[.a.]-c]+ abcd 0 3
579[a-[.c.]]+ abcd 0 3
580[[:alpha:]-a] !
581[a-[:alpha:]] !
582
583; try mutli-character ligatures:
584;[[.ae.]] ae 0 2
585;[[.ae.]] aE -1 -1
586;[[.AE.]] AE 0 2
587;[[.Ae.]] Ae 0 2
588;[[.ae.]-b] a -1 -1
589;[[.ae.]-b] b 0 1
590;[[.ae.]-b] ae 0 2
591;[a-[.ae.]] a 0 1
592;[a-[.ae.]] b -1 -1
593;[a-[.ae.]] ae 0 2
594- match_default normal REG_EXTENDED REG_STARTEND REG_ICASE
595;[[.ae.]] AE 0 2
596;[[.ae.]] Ae 0 2
597;[[.AE.]] Ae 0 2
598;[[.Ae.]] aE 0 2
599;[[.AE.]-B] a -1 -1
600;[[.Ae.]-b] b 0 1
601;[[.Ae.]-b] B 0 1
602;[[.ae.]-b] AE 0 2
603
604- match_default normal REG_EXTENDED REG_STARTEND REG_NO_POSIX_TEST
605\s+ "ab   ab" 2 5
606\S+ "  abc  " 2 5
607
608- match_default normal REG_EXTENDED REG_STARTEND
609\`abc abc 0 3
610\`abc aabc -1 -1
611abc\' abc 0 3
612abc\' abcd -1 -1
613abc\' abc\n\n -1 -1
614abc\' abc 0 3
615
616; extended repeat checking to exercise new algorithms:
617ab.*xy abxy_ 0 4
618ab.*xy ab_xy_ 0 5
619ab.*xy abxy 0 4
620ab.*xy ab_xy 0 5
621ab.* ab 0 2
622ab.* ab__ 0 4
623
624ab.{2,5}xy ab__xy_ 0 6
625ab.{2,5}xy ab____xy_ 0 8
626ab.{2,5}xy ab_____xy_ 0 9
627ab.{2,5}xy ab__xy 0 6
628ab.{2,5}xy ab_____xy 0 9
629ab.{2,5} ab__ 0 4
630ab.{2,5} ab_______ 0 7
631ab.{2,5}xy ab______xy -1 -1
632ab.{2,5}xy ab_xy -1 -1
633
634ab.*?xy abxy_ 0 4
635ab.*?xy ab_xy_ 0 5
636ab.*?xy abxy 0 4
637ab.*?xy ab_xy 0 5
638ab.*? ab 0 2
639ab.*? ab__ 0 4
640
641ab.{2,5}?xy ab__xy_ 0 6
642ab.{2,5}?xy ab____xy_ 0 8
643ab.{2,5}?xy ab_____xy_ 0 9
644ab.{2,5}?xy ab__xy 0 6
645ab.{2,5}?xy ab_____xy 0 9
646ab.{2,5}? ab__ 0 4
647ab.{2,5}? ab_______ 0 7
648ab.{2,5}?xy ab______xy -1 -1
649ab.{2,5}xy ab_xy -1 -1
650
651; again but with slower algorithm variant:
652- match_default REG_EXTENDED
653; now again for single character repeats:
654
655ab_*xy abxy_ 0 4
656ab_*xy ab_xy_ 0 5
657ab_*xy abxy 0 4
658ab_*xy ab_xy 0 5
659ab_* ab 0 2
660ab_* ab__ 0 4
661
662ab_{2,5}xy ab__xy_ 0 6
663ab_{2,5}xy ab____xy_ 0 8
664ab_{2,5}xy ab_____xy_ 0 9
665ab_{2,5}xy ab__xy 0 6
666ab_{2,5}xy ab_____xy 0 9
667ab_{2,5} ab__ 0 4
668ab_{2,5} ab_______ 0 7
669ab_{2,5}xy ab______xy -1 -1
670ab_{2,5}xy ab_xy -1 -1
671
672ab_*?xy abxy_ 0 4
673ab_*?xy ab_xy_ 0 5
674ab_*?xy abxy 0 4
675ab_*?xy ab_xy 0 5
676ab_*? ab 0 2
677ab_*? ab__ 0 4
678
679ab_{2,5}?xy ab__xy_ 0 6
680ab_{2,5}?xy ab____xy_ 0 8
681ab_{2,5}?xy ab_____xy_ 0 9
682ab_{2,5}?xy ab__xy 0 6
683ab_{2,5}?xy ab_____xy 0 9
684ab_{2,5}? ab__ 0 4
685ab_{2,5}? ab_______ 0 7
686ab_{2,5}?xy ab______xy -1 -1
687ab_{2,5}xy ab_xy -1 -1
688
689; and again for sets:
690ab[_,;]*xy abxy_ 0 4
691ab[_,;]*xy ab_xy_ 0 5
692ab[_,;]*xy abxy 0 4
693ab[_,;]*xy ab_xy 0 5
694ab[_,;]* ab 0 2
695ab[_,;]* ab__ 0 4
696
697ab[_,;]{2,5}xy ab__xy_ 0 6
698ab[_,;]{2,5}xy ab____xy_ 0 8
699ab[_,;]{2,5}xy ab_____xy_ 0 9
700ab[_,;]{2,5}xy ab__xy 0 6
701ab[_,;]{2,5}xy ab_____xy 0 9
702ab[_,;]{2,5} ab__ 0 4
703ab[_,;]{2,5} ab_______ 0 7
704ab[_,;]{2,5}xy ab______xy -1 -1
705ab[_,;]{2,5}xy ab_xy -1 -1
706
707ab[_,;]*?xy abxy_ 0 4
708ab[_,;]*?xy ab_xy_ 0 5
709ab[_,;]*?xy abxy 0 4
710ab[_,;]*?xy ab_xy 0 5
711ab[_,;]*? ab 0 2
712ab[_,;]*? ab__ 0 4
713
714ab[_,;]{2,5}?xy ab__xy_ 0 6
715ab[_,;]{2,5}?xy ab____xy_ 0 8
716ab[_,;]{2,5}?xy ab_____xy_ 0 9
717ab[_,;]{2,5}?xy ab__xy 0 6
718ab[_,;]{2,5}?xy ab_____xy 0 9
719ab[_,;]{2,5}? ab__ 0 4
720ab[_,;]{2,5}? ab_______ 0 7
721ab[_,;]{2,5}?xy ab______xy -1 -1
722ab[_,;]{2,5}xy ab_xy -1 -1
723
724; and again for tricky sets with digraphs:
725;ab[_[.ae.]]*xy abxy_ 0 4
726;ab[_[.ae.]]*xy ab_xy_ 0 5
727;ab[_[.ae.]]*xy abxy 0 4
728;ab[_[.ae.]]*xy ab_xy 0 5
729;ab[_[.ae.]]* ab 0 2
730;ab[_[.ae.]]* ab__ 0 4
731
732;ab[_[.ae.]]{2,5}xy ab__xy_ 0 6
733;ab[_[.ae.]]{2,5}xy ab____xy_ 0 8
734;ab[_[.ae.]]{2,5}xy ab_____xy_ 0 9
735;ab[_[.ae.]]{2,5}xy ab__xy 0 6
736;ab[_[.ae.]]{2,5}xy ab_____xy 0 9
737;ab[_[.ae.]]{2,5} ab__ 0 4
738;ab[_[.ae.]]{2,5} ab_______ 0 7
739;ab[_[.ae.]]{2,5}xy ab______xy -1 -1
740;ab[_[.ae.]]{2,5}xy ab_xy -1 -1
741
742;ab[_[.ae.]]*?xy abxy_ 0 4
743;ab[_[.ae.]]*?xy ab_xy_ 0 5
744;ab[_[.ae.]]*?xy abxy 0 4
745;ab[_[.ae.]]*?xy ab_xy 0 5
746;ab[_[.ae.]]*? ab 0 2
747;ab[_[.ae.]]*? ab__ 0 2
748
749;ab[_[.ae.]]{2,5}?xy ab__xy_ 0 6
750;ab[_[.ae.]]{2,5}?xy ab____xy_ 0 8
751;ab[_[.ae.]]{2,5}?xy ab_____xy_ 0 9
752;ab[_[.ae.]]{2,5}?xy ab__xy 0 6
753;ab[_[.ae.]]{2,5}?xy ab_____xy 0 9
754;ab[_[.ae.]]{2,5}? ab__ 0 4
755;ab[_[.ae.]]{2,5}? ab_______ 0 4
756;ab[_[.ae.]]{2,5}?xy ab______xy -1 -1
757;ab[_[.ae.]]{2,5}xy ab_xy -1 -1
758
759; new bugs detected in spring 2003:
760- normal match_continuous REG_NO_POSIX_TEST
761b abc 1 2
762
763() abc 0 0 0 0
764^() abc 0 0 0 0
765^()+ abc 0 0 0 0
766^(){1} abc 0 0 0 0
767^(){2} abc 0 0 0 0
768^((){2}) abc 0 0 0 0 0 0
769() "" 0 0 0 0
770()\1 "" 0 0 0 0
771()\1 a 0 0 0 0
772a()\1b ab 0 2 1 1
773a()b\1 ab 0 2 1 1
774
775; subtleties of matching with no sub-expressions marked
776- normal match_nosubs REG_NO_POSIX_TEST
777a(b?c)+d accd 0 4
778(wee|week)(knights|night) weeknights 0 10
779.* abc 0 3
780a(b|(c))d abd 0 3
781a(b|(c))d acd 0 3
782a(b*|c|e)d abbd 0 4
783a(b*|c|e)d acd 0 3
784a(b*|c|e)d ad 0 2
785a(b?)c abc 0 3
786a(b?)c ac 0 2
787a(b+)c abc 0 3
788a(b+)c abbbc 0 5
789a(b*)c ac 0 2
790(a|ab)(bc([de]+)f|cde) abcdef 0 6
791a([bc]?)c abc 0 3
792a([bc]?)c ac 0 2
793a([bc]+)c abc 0 3
794a([bc]+)c abcc 0 4
795a([bc]+)bc abcbc 0 5
796a(bb+|b)b abb 0 3
797a(bbb+|bb+|b)b abb 0 3
798a(bbb+|bb+|b)b abbb 0 4
799a(bbb+|bb+|b)bb abbb 0 4
800(.*).* abcdef 0 6
801(a*)* bc 0 0
802
803- normal nosubs REG_NO_POSIX_TEST
804a(b?c)+d accd 0 4
805(wee|week)(knights|night) weeknights 0 10
806.* abc 0 3
807a(b|(c))d abd 0 3
808a(b|(c))d acd 0 3
809a(b*|c|e)d abbd 0 4
810a(b*|c|e)d acd 0 3
811a(b*|c|e)d ad 0 2
812a(b?)c abc 0 3
813a(b?)c ac 0 2
814a(b+)c abc 0 3
815a(b+)c abbbc 0 5
816a(b*)c ac 0 2
817(a|ab)(bc([de]+)f|cde) abcdef 0 6
818a([bc]?)c abc 0 3
819a([bc]?)c ac 0 2
820a([bc]+)c abc 0 3
821a([bc]+)c abcc 0 4
822a([bc]+)bc abcbc 0 5
823a(bb+|b)b abb 0 3
824a(bbb+|bb+|b)b abb 0 3
825a(bbb+|bb+|b)b abbb 0 4
826a(bbb+|bb+|b)bb abbb 0 4
827(.*).* abcdef 0 6
828(a*)* bc 0 0
829
830