title: javascript retrieve value from JSON object by matching key using Regex
body: <p>I have the following javascript object literal (excerpt)</p>
  
  <pre><code>var foo = {"hello[35]":100,"goodbye[45]":42};
  </code></pre>
  
  <p>I have the following query:</p>
  
  <pre><code>var query = "hello"
  </code></pre>
  
  <p>I would like to call foo[query] to obtain the value 100, but there is a [35] for which I don't necessarily know the value of. I know for sure that I will get a unique match. Is there any way to input query is some kind of javascript regular expression? i.e.</p>
  
  <pre><code>Regex = /hello/
  foo[Regex]
  100
  </code></pre>
  
  <p>pardon the noob question...</p>