Possible Duplicate:
How to use a variable in regexp expression (TCL/Expect)
I want help in passing varibles to a regexp.
Suppose my code is
set line "MPID:22 condition:AIS"
set id 22
if {[regexp {MPID:$id} $line]} {
puts "inside if"
}
This regexp doesn't work. If I change regexp to
{[regexp {MPID:22} $line]}
it works.
Can someone provide a solution for this.