var text = "Player's got to * play! #justsaying"; var result = text.replace(/[^A-Zds]/gi,''); console.log(result);