2017-02-18 61 views

回答

0

使用正則表達式...

喜歡的東西

>>> tweet = 'some text #tagtag #anothertag' 
>>> import re 
>>> re.findall(r'\B\#\w+\b', tweet) 
['#tagtag', '#anothertag'] 

使用https://www.regex101.com幫你捏捏正則表達式中

相關問題