I need to check if two parameter names exists in the url. If any of them do i need to replace the value of the parameter.
I can match the parameter name, but i am not sure how to replace the value. The two parameters/values would be at the end of the url.
what i have so far is below.
url = “http://www.daniweb.com?parm1=value&parm2=value&parm3=value&parm4=value
// can i combine these some how?
var parm3RegExp = /parm3=/;
var parm4RegExp = /parm4=/;
// finds parm3. Now how can i replace the value?
url = parm3RegExp.exec(url)
I was thinking about something like below. but i want to replace the parameter value and not the name
var url = url.replace(/parm3=/, "");