Not running a regular expression to remove special characters in JS, what's wrong?
Why doesn't this design ? While in php everything is fine 0_o
"& ".replace('/&.*;/', ");
1 answer
You have the regular expression in quotes, that is is searched for a substring.
Try this:
"& ".replace(/[&.*;]/g, ");
Find more questions by tags HTMLJavaScript
var re = new RegExp("&.*;");
"&dsdsfsd; ".replace(re, "); - Carmel_Muell commented on July 9th 19 at 11:25