Strip invalid punctuation from a word