a guest Jun 15th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- def hashtag(text):
- res = re.findall('#.+', text)
- return res
- In : s = "blah-blah, #tag1 blah-blah, #tag2, blah-blah"
- In : tags = re.findall(r'(#w+)', s)
- In : tags
- Out: ['#tag1', '#tag2']
RAW Paste Data