I am a newbie, and I'm having some trouble getting my tcl script working. I've searched around online, and can't seem to understand what I'm doing wrong. Here is what I wrote:
set list {f01-1 f01-2 f02-1 m01-1 m01-2 m02-1}
foreach item $list {
if { [regexp {\w\d\d} $list match ] } {
puts $match
}
}
Here is the output I get:
f01
f01
f01
f01
f01
f01
However, this is what I would like to and expected to get:
f01
f01
f02
m01
m01
f02
Does anyone have any advice for getting what I expected?
Thank you ahead of time!