hag*_*ope 13 python regex string
我只是想在字符串中找到并替换所有出现的twitter url(tweet):
输入:
这是一条带有网址的推文:http://t.co/0DlGChTBIx
输出:
这是一条带有网址的推文:
我试过这个:
p=re.compile(r'\<http.+?\>', re.DOTALL)
tweet_clean = re.sub(p, '', tweet)
zx8*_*x81 45
做这个:
result = re.sub(r"http\S+", "", subject)
http 匹配文字字符\S+ 匹配所有非空白字符(网址的末尾)