Last active
July 14, 2016 20:44
-
-
Save wagnerluis1982/1d347edf2d29707b058397a74835e9cd to your computer and use it in GitHub Desktop.
Function to find hashtags in a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.4 | |
def hashtags(text): | |
return set(re.findall(r"(?:^|\W+)#+(\w+(?!#+.*))\b", text)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment