title: Bash Regular Expression Condition
body: <p>I have a regular expression that I need to verify. The regular expression has double quotes in it, but I can't seem to figure out how to properly escape them.</p>
  
  <p>First attempt, doesn't work as the quotes are not escaped.</p>
  
  <pre><code>while read line
  do
    if [[ $line =~ "&lt;a href="(.+)"&gt;HTTP&lt;/a&gt;" ]]; then
      SOURCE=${BASH_REMATCH[1]}
      break
    fi
  done &lt; tmp/source.html
  
  echo "{$SOURCE}" #output = {"link.html"} (with double quotes)
  </code></pre>
  
  <p>How can I properly run this so the output is <em>link.html</em> without double quotes.</p>
  
  <p>I have tried...</p>
  
  <pre><code>while read line
  do
    if [[ $line =~ "&lt;a href=/"(.+)/"&gt;HTTP&lt;/a&gt;" ]]; then
      SOURCE=${BASH_REMATCH[1]}
      break
    fi
  done &lt; tmp/source.html
  
  echo "{$SOURCE}" #output = {}
  </code></pre>
  
  <p>Without luck. Can someone please help me so I can stop beating my head on my desk? I am not great with Bash. Thank you!</p>