擅长:python、mysql、java
<p>{{cd1>你可以使用多个字符来分割}。。。在</p>
<pre><code>from string import punctuation
import re
puncrx = re.compile(r'[{}\s]'.format(re.escape(punctuation)))
print filter(None, puncrx.split(your_tweet))
</code></pre>
<p>或者,只需查找包含某些连续字符的单词:</p>
^{pr2}$
<p>例如:</p>
<pre><code>print re.findall(r'[\w@#]+', 'talking about #python with @someone is so much fun! Is there a 140 char limit? So not cool!')
# ['talking', 'about', '#python', 'with', '@someone', 'is', 'so', 'much', 'fun', 'Is', 'there', 'a', '140', 'char', 'limit', 'So', 'not', 'cool']
</code></pre>
<p>我最初在这个例子中有一个笑脸,但是当然,这些笑脸最终会被这个方法过滤掉,所以这是值得警惕的。在</p>