Extract Hashtags
Medium · Regex
The re module searches text with patterns. re.findall(pattern, text) returns every match; if the pattern has one group in parentheses, it returns just the group. \w matches a letter, digit or underscore (including letters like é), and + means "one or more". Write patterns as raw strings: r"...".
Write hashtags(text) that finds every hashtag (a # followed by one or more word characters) and returns the tags without the #, lowercased, with duplicates removed, in order of first appearance.
Next: Counter with a Closure