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 omitting the hashbang and anything after it.
This is what I have so far, which ignores the hash but still gets text afterwards. It also still gets everything before the first ?
.
/([^&=#]+)=?([^&#]*)/g
Note: I know about window.location.search
, but I need to be able to pass in any URL string.