1. substition and grouping
{} "" grouping. The difference is that {} prevent substitution,while "" allow substitution.
$varname var substitution
[] command substition
grouping before substitution
2. Pattern Matching
%string match a* alpha
1
%set env(DISPLAY) sunsvr02:0.0
%regexp {([^:]*):} $env(DISPLAY) m1 m2
%set m1 #all matched part
sunsvr02:
%set m2 #matched part in ()
sunsvr02
%set cfile asd.c
%regsub {([^\.]*)\.c} $cfile {cc -c & -o \1.o} ccCmd
%set ccCmd
cc -c asd.c -o sad.o
My Comments: & substited by the string $cfile.