title: Bash regex - different number of backslashes for escaping?
body: <p>Recently I wrote a script with such regex test:</p>
  
  <pre><code># Works fine on Sabayon/Mac, doesn't work on CentOS
  [[ $line =~ (.+)\{(.+)\} ]] || continue
  </code></pre>
  
  <p>It runs smoothly on Sabayon Linux and also on Mac, but then I needed to run it on other environment and script failed. It was CentOS Linux. I found out after a while that I need to make double backlash escape to make it work.</p>
  
  <pre><code># Works fine on CentOS, does not on Sabayon/Mac
  [[ $line =~ (.+)\\{(.+)\\} ]] || continue
  </code></pre>
  
  <p>Environtment list:</p>
  
  <ul>
  <li>CentOS release 5.5 (Final), 2.6.18-194.el5, running GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)</li>
  <li>Sabayon latest release, 3.12.0-sabayon, running GNU bash, version 4.2.45(1)-release (x86_64-pc-linux-gnu)</li>
  <li>OS X 10.9.3, running GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)</li>
  </ul>
  
  <p>Why is that happening? How to make it run on both environments?</p>