Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Split string by hashtag and save into array with jQuery?

Tags:

I have a var that has a string with a series of words, some of which have hashtags, eg:

var words = "#hashtagged no hashtag #antoherhashtag";

I want to save each hashtagged word into an array, kind of like:

var tagslistarr = words.split(' ');

But I am unsure of how to get the characters surrounded by both the # and the space.

Is there a special way of doing this? Is there some ASCII characters I am meant to use to identify this?