Is there an easy way to do the equivalent in jquery or jscript for that matter.
NewString = Regex.Replace(SOMESTRING, "[^a-z0-9A-Z -]")
Is there an easy way to do the equivalent in jquery or jscript for that matter.
NewString = Regex.Replace(SOMESTRING, "[^a-z0-9A-Z -]")
Like this:
newString = someString.replace(/[^a-z0-9A-Z -]/g, "");
Without the g
(Global) flag,it will only replace the first match.
NewString = SOMESTRING.replace(/[^a-z0-9A-Z -]/g, "new string")
But what you wrote isn't actually a valid static method of Regex.