Posted to tcl by apn at Tue Sep 20 17:45:13 GMT 2022view pretty

With Tcl 8.6.12

% switch -regexp -matchvar m -indexvar i ac {
{(a)(b)?(c)} {puts m:$m; puts i:$i}
}
m:ac a {} c
i:{0 1} {0 0} {-1 -1} {1 1}
% info patch
8.6.12

With Tcl 8.7

% switch -regexp -matchvar m -indexvar i ac {
{(a)(b)?(c)} {puts m:$m; puts i:$i}
}
m:ac a ac c
i:{0 1} {0 0} {-1 -1} {1 1}
% info patch
8.7a6