Find the Hashtags
You're working at Twitter and you've been tasked with writing a feature that finds hashtags in a post (a word that is prefixed with a #) to add to a database of hashtag words for further use in searching.
Write a function that takes in a tweet as a string and returns an array of all of the words (minus the # in front of them), with the following in mind:
A simple "#" (without a word following it) is not a hashtag.
If a word has more than one "#" in front of it, such as "##beautiful", the hashtag is "#beautiful".
Hashtags cannot be within the middle of a word (eg, "hello#there" isn't a hashtag).
Hashtags must only be alphabetical (so #5234 or #??!&%$ aren't valid).
A valid hashtag inputted as a string into your method (eg, "here's my cute #kitten") should return an array like so: ["kitten"]
Be sure to check out the tests for more guidance in how to construct your regex.
Test your regex with Rubular
View Find the Hashtags on Learn.co and start learning to code for free.