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

  1. With Tcl 8.6.12
  2.  
  3. % switch -regexp -matchvar m -indexvar i ac {
  4. {(a)(b)?(c)} {puts m:$m; puts i:$i}
  5. }
  6. m:ac a {} c
  7. i:{0 1} {0 0} {-1 -1} {1 1}
  8. % info patch
  9. 8.6.12
  10.  
  11. With Tcl 8.7
  12.  
  13. % switch -regexp -matchvar m -indexvar i ac {
  14. {(a)(b)?(c)} {puts m:$m; puts i:$i}
  15. }
  16. m:ac a ac c
  17. i:{0 1} {0 0} {-1 -1} {1 1}
  18. % info patch
  19. 8.7a6