title: bash regex with quotes?
body: <p>The following code</p>
  
  <pre><code>number=1
  if [[ $number =~ [0-9] ]]
  then
    echo matched
  fi
  </code></pre>
  
  <p>works. If I try to use quotes in the regex, however, it stops:</p>
  
  <pre><code>number=1
  if [[ $number =~ "[0-9]" ]]
  then
    echo matched
  fi
  </code></pre>
  
  <p>I tried <code>"\[0-9\]"</code>, too. What am I missing?</p>
  
  <p>Funnily enough, <a href="http://www.tldp.org/LDP/abs/html/abs-guide.html#REGEXMATCHREF" rel="noreferrer">bash advanced scripting guide</a> suggests this should work.</p>
  
  <p>Bash version 3.2.39.</p>