Skip to content

Instantly share code, notes, and snippets.

@wagnerluis1982
Last active July 14, 2016 20:44
Show Gist options
  • Save wagnerluis1982/1d347edf2d29707b058397a74835e9cd to your computer and use it in GitHub Desktop.
Save wagnerluis1982/1d347edf2d29707b058397a74835e9cd to your computer and use it in GitHub Desktop.
Function to find hashtags in a string
#!/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