擅长:python、mysql、java
<p><strike>这将适用于您的示例。如果你的tweets中有链接,它将失败,<strong>惨</strong></strike></p>
<pre><code>result = re.sub(r"(?:@\S*|#\S*|http(?=.*://)\S*)", "", subject)
</code></pre>
<p><strong>编辑:</strong></p>
<p>也适用于内部链接,只要它们被空间分隔开。</p>
<p>只需使用API。为什么要重新发明轮子?</p>