xref: /freebsd-src/contrib/netbsd-tests/lib/libc/regex/data/att/repetition.dat (revision 9268022b74279434ed6300244e3f977e56a8ceb5)
1*57718be8SEnji CooperNOTE	implicit vs. explicit repetitions : 2009-02-02
2*57718be8SEnji Cooper
3*57718be8SEnji Cooper# Glenn Fowler <gsf@research.att.com>
4*57718be8SEnji Cooper# conforming matches (column 4) must match one of the following BREs
5*57718be8SEnji Cooper#	NOMATCH
6*57718be8SEnji Cooper#	(0,.)\((\(.\),\(.\))(?,?)(\2,\3)\)*
7*57718be8SEnji Cooper#	(0,.)\((\(.\),\(.\))(\2,\3)(?,?)\)*
8*57718be8SEnji Cooper# i.e., each 3-tuple has two identical elements and one (?,?)
9*57718be8SEnji Cooper
10*57718be8SEnji CooperE	((..)|(.))				NULL		NOMATCH
11*57718be8SEnji CooperE	((..)|(.))((..)|(.))			NULL		NOMATCH
12*57718be8SEnji CooperE	((..)|(.))((..)|(.))((..)|(.))		NULL		NOMATCH
13*57718be8SEnji Cooper
14*57718be8SEnji CooperE	((..)|(.)){1}				NULL		NOMATCH
15*57718be8SEnji CooperE	((..)|(.)){2}				NULL		NOMATCH
16*57718be8SEnji CooperE	((..)|(.)){3}				NULL		NOMATCH
17*57718be8SEnji Cooper
18*57718be8SEnji CooperE	((..)|(.))*				NULL		(0,0)
19*57718be8SEnji Cooper
20*57718be8SEnji CooperE	((..)|(.))				a		(0,1)(0,1)(?,?)(0,1)
21*57718be8SEnji CooperE	((..)|(.))((..)|(.))			a		NOMATCH
22*57718be8SEnji CooperE	((..)|(.))((..)|(.))((..)|(.))		a		NOMATCH
23*57718be8SEnji Cooper
24*57718be8SEnji CooperE	((..)|(.)){1}				a		(0,1)(0,1)(?,?)(0,1)
25*57718be8SEnji CooperE	((..)|(.)){2}				a		NOMATCH
26*57718be8SEnji CooperE	((..)|(.)){3}				a		NOMATCH
27*57718be8SEnji Cooper
28*57718be8SEnji CooperE	((..)|(.))*				a		(0,1)(0,1)(?,?)(0,1)
29*57718be8SEnji Cooper
30*57718be8SEnji CooperE	((..)|(.))				aa		(0,2)(0,2)(0,2)(?,?)
31*57718be8SEnji CooperE	((..)|(.))((..)|(.))			aa		(0,2)(0,1)(?,?)(0,1)(1,2)(?,?)(1,2)
32*57718be8SEnji CooperE	((..)|(.))((..)|(.))((..)|(.))		aa		NOMATCH
33*57718be8SEnji Cooper
34*57718be8SEnji CooperE	((..)|(.)){1}				aa		(0,2)(0,2)(0,2)(?,?)
35*57718be8SEnji CooperE	((..)|(.)){2}				aa		(0,2)(1,2)(?,?)(1,2)
36*57718be8SEnji CooperE	((..)|(.)){3}				aa		NOMATCH
37*57718be8SEnji Cooper
38*57718be8SEnji CooperE	((..)|(.))*				aa		(0,2)(0,2)(0,2)(?,?)
39*57718be8SEnji Cooper
40*57718be8SEnji CooperE	((..)|(.))				aaa		(0,2)(0,2)(0,2)(?,?)
41*57718be8SEnji CooperE	((..)|(.))((..)|(.))			aaa		(0,3)(0,2)(0,2)(?,?)(2,3)(?,?)(2,3)
42*57718be8SEnji CooperE	((..)|(.))((..)|(.))((..)|(.))		aaa		(0,3)(0,1)(?,?)(0,1)(1,2)(?,?)(1,2)(2,3)(?,?)(2,3)
43*57718be8SEnji Cooper
44*57718be8SEnji CooperE	((..)|(.)){1}				aaa		(0,2)(0,2)(0,2)(?,?)
45*57718be8SEnji CooperE	((..)|(.)){2}				aaa		(0,3)(2,3)(?,?)(2,3)
46*57718be8SEnji CooperE	((..)|(.)){3}				aaa		(0,3)(2,3)(?,?)(2,3)
47*57718be8SEnji Cooper
48*57718be8SEnji CooperE	((..)|(.))*				aaa		(0,3)(2,3)(?,?)(2,3)
49*57718be8SEnji Cooper
50*57718be8SEnji CooperE	((..)|(.))				aaaa		(0,2)(0,2)(0,2)(?,?)
51*57718be8SEnji CooperE	((..)|(.))((..)|(.))			aaaa		(0,4)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)
52*57718be8SEnji CooperE	((..)|(.))((..)|(.))((..)|(.))		aaaa		(0,4)(0,2)(0,2)(?,?)(2,3)(?,?)(2,3)(3,4)(?,?)(3,4)
53*57718be8SEnji Cooper
54*57718be8SEnji CooperE	((..)|(.)){1}				aaaa		(0,2)(0,2)(0,2)(?,?)
55*57718be8SEnji CooperE	((..)|(.)){2}				aaaa		(0,4)(2,4)(2,4)(?,?)
56*57718be8SEnji CooperE	((..)|(.)){3}				aaaa		(0,4)(3,4)(?,?)(3,4)
57*57718be8SEnji Cooper
58*57718be8SEnji CooperE	((..)|(.))*				aaaa		(0,4)(2,4)(2,4)(?,?)
59*57718be8SEnji Cooper
60*57718be8SEnji CooperE	((..)|(.))				aaaaa		(0,2)(0,2)(0,2)(?,?)
61*57718be8SEnji CooperE	((..)|(.))((..)|(.))			aaaaa		(0,4)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)
62*57718be8SEnji CooperE	((..)|(.))((..)|(.))((..)|(.))		aaaaa		(0,5)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)(4,5)(?,?)(4,5)
63*57718be8SEnji Cooper
64*57718be8SEnji CooperE	((..)|(.)){1}				aaaaa		(0,2)(0,2)(0,2)(?,?)
65*57718be8SEnji CooperE	((..)|(.)){2}				aaaaa		(0,4)(2,4)(2,4)(?,?)
66*57718be8SEnji CooperE	((..)|(.)){3}				aaaaa		(0,5)(4,5)(?,?)(4,5)
67*57718be8SEnji Cooper
68*57718be8SEnji CooperE	((..)|(.))*				aaaaa		(0,5)(4,5)(?,?)(4,5)
69*57718be8SEnji Cooper
70*57718be8SEnji CooperE	((..)|(.))				aaaaaa		(0,2)(0,2)(0,2)(?,?)
71*57718be8SEnji CooperE	((..)|(.))((..)|(.))			aaaaaa		(0,4)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)
72*57718be8SEnji CooperE	((..)|(.))((..)|(.))((..)|(.))		aaaaaa		(0,6)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)(4,6)(4,6)(?,?)
73*57718be8SEnji Cooper
74*57718be8SEnji CooperE	((..)|(.)){1}				aaaaaa		(0,2)(0,2)(0,2)(?,?)
75*57718be8SEnji CooperE	((..)|(.)){2}				aaaaaa		(0,4)(2,4)(2,4)(?,?)
76*57718be8SEnji CooperE	((..)|(.)){3}				aaaaaa		(0,6)(4,6)(4,6)(?,?)
77*57718be8SEnji Cooper
78*57718be8SEnji CooperE	((..)|(.))*				aaaaaa		(0,6)(4,6)(4,6)(?,?)
79*57718be8SEnji Cooper
80*57718be8SEnji CooperNOTE	additional repetition tests graciously provided by Chris Kuklewicz www.haskell.org 2009-02-02
81*57718be8SEnji Cooper
82*57718be8SEnji Cooper# These test a bug in OS X / FreeBSD / NetBSD, and libtree.
83*57718be8SEnji Cooper# Linux/GLIBC gets the {8,} and {8,8} wrong.
84*57718be8SEnji Cooper
85*57718be8SEnji Cooper:HA#100:E	X(.?){0,}Y	X1234567Y	(0,9)(7,8)
86*57718be8SEnji Cooper:HA#101:E	X(.?){1,}Y	X1234567Y	(0,9)(7,8)
87*57718be8SEnji Cooper:HA#102:E	X(.?){2,}Y	X1234567Y	(0,9)(7,8)
88*57718be8SEnji Cooper:HA#103:E	X(.?){3,}Y	X1234567Y	(0,9)(7,8)
89*57718be8SEnji Cooper:HA#104:E	X(.?){4,}Y	X1234567Y	(0,9)(7,8)
90*57718be8SEnji Cooper:HA#105:E	X(.?){5,}Y	X1234567Y	(0,9)(7,8)
91*57718be8SEnji Cooper:HA#106:E	X(.?){6,}Y	X1234567Y	(0,9)(7,8)
92*57718be8SEnji Cooper:HA#107:E	X(.?){7,}Y	X1234567Y	(0,9)(7,8)
93*57718be8SEnji Cooper:HA#108:E	X(.?){8,}Y	X1234567Y	(0,9)(8,8)
94*57718be8SEnji Cooper:HA#110:E	X(.?){0,8}Y	X1234567Y	(0,9)(7,8)
95*57718be8SEnji Cooper:HA#111:E	X(.?){1,8}Y	X1234567Y	(0,9)(7,8)
96*57718be8SEnji Cooper:HA#112:E	X(.?){2,8}Y	X1234567Y	(0,9)(7,8)
97*57718be8SEnji Cooper:HA#113:E	X(.?){3,8}Y	X1234567Y	(0,9)(7,8)
98*57718be8SEnji Cooper:HA#114:E	X(.?){4,8}Y	X1234567Y	(0,9)(7,8)
99*57718be8SEnji Cooper:HA#115:E	X(.?){5,8}Y	X1234567Y	(0,9)(7,8)
100*57718be8SEnji Cooper:HA#116:E	X(.?){6,8}Y	X1234567Y	(0,9)(7,8)
101*57718be8SEnji Cooper:HA#117:E	X(.?){7,8}Y	X1234567Y	(0,9)(7,8)
102*57718be8SEnji Cooper:HA#118:E	X(.?){8,8}Y	X1234567Y	(0,9)(8,8)
103*57718be8SEnji Cooper
104*57718be8SEnji Cooper# These test a fixed bug in my regex-tdfa that did not keep the expanded
105*57718be8SEnji Cooper# form properly grouped, so right association did the wrong thing with
106*57718be8SEnji Cooper# these ambiguous patterns (crafted just to test my code when I became
107*57718be8SEnji Cooper# suspicious of my implementation).  The first subexpression should use
108*57718be8SEnji Cooper# "ab" then "a" then "bcd".
109*57718be8SEnji Cooper
110*57718be8SEnji Cooper# OS X / FreeBSD / NetBSD badly fail many of these, with impossible
111*57718be8SEnji Cooper# results like (0,6)(4,5)(6,6).
112*57718be8SEnji Cooper
113*57718be8SEnji Cooper:HA#260:E	(a|ab|c|bcd){0,}(d*)	ababcd	(0,6)(3,6)(6,6)
114*57718be8SEnji Cooper:HA#261:E	(a|ab|c|bcd){1,}(d*)	ababcd	(0,6)(3,6)(6,6)
115*57718be8SEnji Cooper:HA#262:E	(a|ab|c|bcd){2,}(d*)	ababcd	(0,6)(3,6)(6,6)
116*57718be8SEnji Cooper:HA#263:E	(a|ab|c|bcd){3,}(d*)	ababcd	(0,6)(3,6)(6,6)
117*57718be8SEnji Cooper:HA#264:E	(a|ab|c|bcd){4,}(d*)	ababcd	NOMATCH
118*57718be8SEnji Cooper:HA#265:E	(a|ab|c|bcd){0,10}(d*)	ababcd	(0,6)(3,6)(6,6)
119*57718be8SEnji Cooper:HA#266:E	(a|ab|c|bcd){1,10}(d*)	ababcd	(0,6)(3,6)(6,6)
120*57718be8SEnji Cooper:HA#267:E	(a|ab|c|bcd){2,10}(d*)	ababcd	(0,6)(3,6)(6,6)
121*57718be8SEnji Cooper:HA#268:E	(a|ab|c|bcd){3,10}(d*)	ababcd	(0,6)(3,6)(6,6)
122*57718be8SEnji Cooper:HA#269:E	(a|ab|c|bcd){4,10}(d*)	ababcd	NOMATCH
123*57718be8SEnji Cooper:HA#270:E	(a|ab|c|bcd)*(d*)	ababcd	(0,6)(3,6)(6,6)
124*57718be8SEnji Cooper:HA#271:E	(a|ab|c|bcd)+(d*)	ababcd	(0,6)(3,6)(6,6)
125*57718be8SEnji Cooper
126*57718be8SEnji Cooper# The above worked on Linux/GLIBC but the following often fail.
127*57718be8SEnji Cooper# They also trip up OS X / FreeBSD / NetBSD:
128*57718be8SEnji Cooper
129*57718be8SEnji Cooper:HA#280:E	(ab|a|c|bcd){0,}(d*)	ababcd	(0,6)(3,6)(6,6)
130*57718be8SEnji Cooper:HA#281:E	(ab|a|c|bcd){1,}(d*)	ababcd	(0,6)(3,6)(6,6)
131*57718be8SEnji Cooper:HA#282:E	(ab|a|c|bcd){2,}(d*)	ababcd	(0,6)(3,6)(6,6)
132*57718be8SEnji Cooper:HA#283:E	(ab|a|c|bcd){3,}(d*)	ababcd	(0,6)(3,6)(6,6)
133*57718be8SEnji Cooper:HA#284:E	(ab|a|c|bcd){4,}(d*)	ababcd	NOMATCH
134*57718be8SEnji Cooper:HA#285:E	(ab|a|c|bcd){0,10}(d*)	ababcd	(0,6)(3,6)(6,6)
135*57718be8SEnji Cooper:HA#286:E	(ab|a|c|bcd){1,10}(d*)	ababcd	(0,6)(3,6)(6,6)
136*57718be8SEnji Cooper:HA#287:E	(ab|a|c|bcd){2,10}(d*)	ababcd	(0,6)(3,6)(6,6)
137*57718be8SEnji Cooper:HA#288:E	(ab|a|c|bcd){3,10}(d*)	ababcd	(0,6)(3,6)(6,6)
138*57718be8SEnji Cooper:HA#289:E	(ab|a|c|bcd){4,10}(d*)	ababcd	NOMATCH
139*57718be8SEnji Cooper:HA#290:E	(ab|a|c|bcd)*(d*)	ababcd	(0,6)(3,6)(6,6)
140*57718be8SEnji Cooper:HA#291:E	(ab|a|c|bcd)+(d*)	ababcd	(0,6)(3,6)(6,6)
141