I have the following Regex:
The regex is in a bit of code in our app, I can see it splits words. It obviously removes characters such as $#* and so on. I need it to do the same thing exactly but allow the a hash tag, since the words can now have #hashtags.
"Test #words".toLowerCase().split(/\b/).filter(function(w){return w.match(/^\w+$/) }) // returns ["test", "words"]
The current Regex removes the hash, i want it to remain. So i get:
["test", "#words"]
.split(/\s+/)?\sbe sufficient?