擅长:python、mysql、java
<p>不需要正则表达式来查找静态字符串。您应该使用这个Python习惯用法来查找字符串:</p>
<pre><code>>>> haystack = 'this is the string to search!'
>>> needle = '!'
>>> if needle in haystack:
print 'Found', needle
</code></pre>
<p>创建列表非常简单-</p>
<pre><code>>>> matches = []
</code></pre>
<p>储存火柴也很容易。。。</p>
<pre><code>>>> matches.append('add this string to matches')
</code></pre>
<p>这应该足够让你开始了。祝你好运!</p>
<p>一个补遗来处理下面的评论。。。</p>
<pre><code>l = []
for quote in matches:
print quote
l.append(quote)
</code></pre>