I'd like to use a regular expression function to remove an item from a querystring based on the key.
Say I have a querystring like this:
page.asp?item1=data1&item2=data2&item3=data3
I would like to call a function like this:
newQs = removeQsItem(url, "item2")
...and have that function return this:
page.asp?item1=data1&item3=data3
... but I also need it to work if called with item 1 or 3 - regardless of their position in the querystring.
My tactic so far it to try and grab "requiredItem={anything but ampersand here}". But I'm really struggling with regex syntax and my brain is about to melt.
Any help would be greatly appreciated.