<script type="text/javascript">
var currstr = "?distance=10&city=Boston&criteria=shoes&size=10";
var selcity = "California"; //This can come from a drop down
var pat = new RegExp([NEEDPATTERN],"gi");
currstr.replace(pat,selcity);
</script>
I need some help replacing city=Boston in currstr with a value user selects from
drop down, right now I have hardcoded value in var selcity. I have placed a [NEEDPATTERN] marker for pattern that can be used to achieve this.
Can someone help me with this pattern?