SyntaxFix
Write A Post
Hire A Developer
Questions
Try to use this one
var result= stringToReplace.replace(/[^\w\s]/g, '')
[^] is for negation, \w for [a-zA-Z0-9_] word characters and \s for space, /[]/g for global
[^]
\w
[a-zA-Z0-9_]
\s
/[]/g