Q:

need to modify this Regex to not remove a character

I have the following regexp (/\?(.*?)\&/) which when I use it in the following javascript code it removes the "?" from the replacement result.
href=href.replace((/\?(.*?)\&/),"")

The beginning href value is this...
/ShoppingCart.asp?ProductCode=238HOSE&CouponCode=test

I get this as my result right now...
/ShoppingCart.aspCouponCode=test

I would like to get this...
/ShoppingCart.asp?CouponCode=test

How would I modify the Regexp to do this
Thanks for you help. 

A:

To do it properly, you'll need a regex lookbehind, however this should work in your case:
href=href.replace((/\?(.*?)\&/),"?")

