nodejs remove unsafe string code example Example: nodejs remove unsafe string const str = "abc's test#s"; console.log(str.replace(/[^a-zA-Z ]/g, ""));