If I have the following line:
var str = "Test.aspx?ID=11&clicked=false+5+3"; str = str.replace(????????, 'true');
How to replace the substring "false + 5 + 3" with "true" using REGEX?
Thanks in advance!
str = str.replace(/clicked=[^&]*/, 'clicked=true');
this will replace anything in the clicked parameter, not just false + ...
str = str.replace(/false\+5\+3/, 'true');
You need to exit +, as it means something special in the regular expression.
+
var str = "Test.aspx?ID=11&clicked=false+5+3"; str = str.replace(/false[+]5[+]3/, 'true');