I'm trying to create a post having tags in between. So I'm trying to retrieve all the keyword which are followed by # using simple regex expression.
var hashtag = $('p').text().match(/#\w+\s/);
console.log(hashtag);
I'm using the .match()
function to find the match of the defined regex expression, but it is only displaying one keyword, whereas I have two.
Is there any way to retrieve multiple keywords?