I would like to remove all special characters (except for numbers) from a string. I have been able to get this far
var name = name.replace(/[^a-zA-Z ]/, \"\");
<
to remove symbol use tag [ ]
step:1
[]
step 2:place what symbol u want to remove eg:@ like [@]
[@]
step 3:
var name = name.replace(/[@]/g, "");
thats it
var name="ggggggg@fffff"
var result = name.replace(/[@]/g, "");
console .log(result)
Extra Tips
To remove space (give one space into square bracket like []=>[ ])
[@ ]
It Remove Everything (using except)
[^place u dont want to remove]
eg:i remove everyting except alphabet (small and caps)
[^a-zA-Z ]
var name="ggggg33333@#$%^&**I(((**gg@fffff"
var result = name.replace(/[^a-zA-Z]/g, "");
console .log(result)