There are some strings
"string numbe1 fdsf gfdgfdgf (value1)" "string numbe2 fdsf gfdgfdgf (value2)" "string numbe3 fdsf gfdgfdgf (value3)" "string numbe5 fdsf gfdgfdgf (value1)" "string numbe5 fdsf gfdgfdgf (value2)"
(valueN) can be either
string numbe1 fdsf gfdgfdgf
Here is what I did (and which is not working as I want)
var newString = originalString.replace(/(value1)|(value2)|(value3)/g,"") ;
How can I solve it?
you need to escape the parenthesis, and you have an extra
. right before
"string numbe5 fdsf gfdgfdgf (value2)".replace(/\(value[1-3]\)/, '')