title: Regex - Get query string without hash
body: <p>Need to be able to pass in a URL, and the regex should be able to extract just the query string. The key part though is <strong>omitting the hashbang</strong> and <strong>anything after it</strong>.</p>
  
  <p>This is what I have so far, which ignores the hash but still gets text afterwards. It also still gets everything before the first <code>?</code>.</p>
  
  <p><code>/([^&amp;=#]+)=?([^&amp;#]*)/g</code></p>
  
  <p>Note: I know about <code>window.location.search</code>, but I need to be able to pass in any URL string.</p>