title: Tcl regular expression to detect square brackets
body: <p>I have a .csv files where many rows have one of the field values like this:</p>
  
  <pre><code>scl[0]
  scl[1]
  scl[2]
  sda[1]
  sda[2]
  sda[3]
  </code></pre>
  
  <p>I am storing them in a variable while reading the csv files in line by line format,like:</p>
  
  <pre><code> set string [$m get cell 0 1]
  </code></pre>
  
  <p>Now when I do regexp to check whether the cell has <code>scl[0]</code> I am unable to pass the square bracket to this regular expression:
  I gave this syntax:</p>
  
  <pre><code>if{[regexp "scl\[0\]" $string]} {
  ...
  }
  </code></pre>
  
  <p>But the if condition doesn't get executed.</p>
  
  <p>If in case of <code>scl(0)</code>, i.e <code>()</code> instead of <code>{}</code> in csv file, I gave <code>{[regexp "scl\[(\]0\[)\]" $string]}</code> which worked. The same format I tried apply to square brackets still it doesn't get evaluated.</p>
  
  <p>Am I missing something?</p>
  
  <p>Please help.</p>
  
  <p>Thanks</p>