title: How can I match square bracket in Regex Scala?
body: <p>I am trying to match <code>[</code>and <code>]</code>. 
  but the when we also use the two for regular expression, 
  how can I write some pattern to match the two brackets?
  Using <code>\[</code> does not work as it gives out compiler error for the following line:</p>
  
  <pre><code> regex(new Regex("([^.#; \\t\\r\n(){}\[\]',`\"][^; \\t\\r\\n(){}\[\]',`\"]*|[.][^; \\t\\r\\n(){}\[\]',`\"]+)"))
  </code></pre>