I want to replace all the characters in a string with underscore except for the first word, but my code replaces all the characters with an underscore.
Expected result: Hello ___ __ _________
var regex = /[a-z0-9,.':!?"]/gi;
var str = "Hello I'm an astronaut";
console.log(str.replace(regex, "_"));