SHARE
TWEET

Untitled

a guest Jun 15th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def hashtag(text):
  2.     res = re.findall('#.+', text)
  3.     return res
  4.      
  5. In [51]: s = "blah-blah, #tag1 blah-blah, #tag2, blah-blah"
  6.  
  7. In [52]: tags = re.findall(r'(#w+)', s)
  8.  
  9. In [53]: tags
  10. Out[53]: ['#tag1', '#tag2']
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top