title: Bash regex match on JSON structure
body: <p>I have a JSON structure like this which I've read into a bash variable as a string:</p>
  
  <pre><code>{
          "elem1": "val1",
          "THEELEM": "THEVAL",
          "elem3": "val3"
  }
  </code></pre>
  
  <p>I want to use regex to match on <code>"THEELEM": "THEVAL"</code>. It works if I try individual words, where the JSON is stored in <code>result</code> as a string:</p>
  
  <pre><code>[[ $result =~ THEVAL ]] &amp;&amp; echo "yes"
  </code></pre>
  
  <p>But I want to match on the key-pair like this:</p>
  
  <pre><code>[[ $result =~ "THEELEM": "THEVAL" ]] &amp;&amp; echo "yes"
  </code></pre>
  
  <p>That gives me syntax issues. I've tried escaping, single-quotes and triple quotes to no avail. Any help appreciated.</p>