javascript split string by different characters code example Example: how to split by words and punctuation in javascript string.split(/\s*\b\s*/)