title: passing variables inside a regexp in tcl
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/11768739/how-to-use-a-variable-in-regexp-expression-tcl-expect">How to use a variable in regexp expression (TCL/Expect)</a>  </p>
  </blockquote>
  
  
  
  <p>I want help in passing varibles to a regexp.</p>
  
  <p>Suppose my code is </p>
  
  <pre><code>set line "MPID:22 condition:AIS"
  set id 22
  if {[regexp {MPID:$id} $line]} {
  puts "inside if"
  }
  </code></pre>
  
  <p>This regexp doesn't work. If I change regexp to </p>
  
  <pre><code>{[regexp {MPID:22} $line]} 
  </code></pre>
  
  <p>it works.</p>
  
  <p>Can someone provide a solution for this.</p>