Is there a way to return all words in a given string? The best solution I have currently found is using the match method and returning any string with at least one non-whitespace char (/\S+/g).
The issue with this method is that it includes a comma, period, etc. in the word. If I try using a RegExp with \w, then it doesn't include periods and commas, but it makes "don't" two words because of the '.
Is there any true and easy solution to this issue?
For example: "I don't want to go, mom". This should return the words [I, don't, want, to, go, mom]