Lines Matching +full:1 +full:c
3 # Tests for the :C,from,to, variable modifier.
9 all: mod-regex-limits-{1,2,3,4,5,6}
10 all: mod-regex-errors-{1,2}
16 .if ${:Ua b b c:C,a b,,} != "a b b c"
20 # Using the '1' modifier does not change anything. The '1' modifier just
21 # means to apply at most 1 replacement in the whole expression.
22 .if ${:Ua b b c:C,a b,,1} != "a b b c"
29 .if ${:Ua b b c:C,a b,,W} != " b c"
35 .if ${:Ua b b c:C,b,,g} != "a c"
39 # The first :C modifier has the 'W' modifier, which makes the whole
41 # of "1 2" with "___". The 'W' modifier only applies to this single :C
42 # modifier. This is demonstrated by the :C modifier that follows. If the
45 .if ${:U1 2 3 1 2 3:C,1 2,___,Wg:C,_,x,} != "x__ 3 x__ 3"
56 .if ${:U1 23 456:C,..,\0\0,} != "1 2323 45456"
60 # The modifier '1' applies the replacement at most once, across the whole
64 # Up to 2020-08-28, the manual page said that the modifiers '1' and 'g'
66 # 'g' and '1' at the same time.
67 .if ${:U12345 12345:C,.,\0\0,1} != "112345 12345"
75 .if ${:U1a2b3c:C,a*,*,g} != "*1**2*b*3*c"
83 .if ${:U"${.newline}":C,.,.,g} != "..."
88 # Like the ':S' modifier, the ':C' modifier matches on an expression
94 .if "<${:U:S,,unanchored,}> <${:U:C,.?,unanchored,}>" != "<> <unanchored>"
97 .if "<${:U:S,^,prefix,}> <${:U:C,^,prefix,}>" != "<prefix> <prefix>"
100 .if "<${:U:S,$,suffix,}> <${:U:C,$,suffix,}>" != "<suffix> <suffix>"
103 .if "<${:U:S,^$,whole,}> <${:U:C,^$,whole,}>" != "<whole> <whole>"
106 .if "<${:U:S,,unanchored,g}> <${:U:C,.?,unanchored,g}>" != "<> <unanchored>"
109 .if "<${:U:S,^,prefix,g}> <${:U:C,^,prefix,g}>" != "<prefix> <prefix>"
112 .if "<${:U:S,$,suffix,g}> <${:U:C,$,suffix,g}>" != "<suffix> <suffix>"
115 .if "<${:U:S,^$,whole,g}> <${:U:C,^$,whole,g}>" != "<whole> <whole>"
118 .if "<${:U:S,,unanchored,W}> <${:U:C,.?,unanchored,W}>" != "<> <unanchored>"
121 .if "<${:U:S,^,prefix,W}> <${:U:C,^,prefix,W}>" != "<prefix> <prefix>"
124 .if "<${:U:S,$,suffix,W}> <${:U:C,$,suffix,W}>" != "<suffix> <suffix>"
127 .if "<${:U:S,^$,whole,W}> <${:U:C,^$,whole,W}>" != "<whole> <whole>"
138 @echo $@: ${:Uword1 word2:C,****,____,g:C,word,____,:Q}.
142 mod-regex-limits-1:
143 @echo $@:11-missing:${:U1 23 456:C,..,\1\1,:Q}
145 @echo $@:11-ok:${:U1 23 456:C,(.).,\1\1,:Q}
147 @echo $@:22-missing:${:U1 23 456:C,..,\2\2,:Q}
149 @echo $@:22-missing:${:U1 23 456:C,(.).,\2\2,:Q}
151 @echo $@:22-ok:${:U1 23 456:C,(.)(.),\2\2,:Q}
153 # The :C modifier only handles single-digit capturing groups,
155 …apture:${:UabcdefghijABCDEFGHIJrest:C,(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)…
157 mod-regex-errors-1:
158 @echo $@: ${UNDEF:Uvalue:C,[,,}
164 @echo $@: ${word:L:C,.*,x${:U:Z}y,W}
170 # Between var.c 1.16 from 1996-12-24 until before var.c 1.933 from 2021-06-21,
178 # Since var.c 1.933 from 2021-06-21, the error message is only printed in lint
181 # As an alternative to the change from var.c 1.933 from 2021-06-21, a possible
183 # '1Wg' modifiers of the ':C' modifier. That modifier could have been used in
184 # the modifier ':C,(a.)|(b.),\1\2,U' to treat unmatched subexpressions as
186 # modifiers ':S' and ':C' are open-ended (see mod-subst-chain), that is, they
188 # Luckily the modifier :U does not make sense after :C, therefore this case
192 # all, the subexpression \1 matches as well.
193 @echo $@.ok: ${:U1 1 2 3 5 8 13 21 34:C,1(.*),one\1,}
196 # * The subexpression \1 is only defined for 1 and 13.
201 @echo $@.1: ${:U 1:C,1(.*)|2(.*),(\1)(\2),:Q} # missing \2
202 @echo $@.1: ${:U 1:C,1(.*)|2(.*),(\1)(\2),:Q} # missing \2
203 @echo $@.2: ${:U 2:C,1(.*)|2(.*),(\1)(\2),:Q} # missing \1
204 @echo $@.3: ${:U 3:C,1(.*)|2(.*),(\1)(\2),:Q}
205 @echo $@.5: ${:U 5:C,1(.*)|2(.*),(\1)(\2),:Q}
206 @echo $@.8: ${:U 8:C,1(.*)|2(.*),(\1)(\2),:Q}
207 @echo $@.13: ${:U 13:C,1(.*)|2(.*),(\1)(\2),:Q} # missing \2
208 @echo $@.21: ${:U 21:C,1(.*)|2(.*),(\1)(\2),:Q} # missing \1
209 @echo $@.34: ${:U 34:C,1(.*)|2(.*),(\1)(\2),:Q}
211 # And now all together: 5 error messages for 1, 1, 2, 13, 21.
212 @echo $@.all: ${:U1 1 2 3 5 8 13 21 34:C,1(.*)|2(.*),(\1)(\2),:Q}