擅长:python、mysql、java
<p><code>startswith</code>不解释正则表达式。使用导入的re模块检查字符串是否匹配:</p>
<pre><code>if re.match('^[a-zA-Z]+', line) is not None:
print line
</code></pre>
<p>开始于:<code>^</code></p>
<p>一个或多个匹配字符:<code>+</code></p>
<p><a href="http://www.fon.hum.uva.nl/praat/manual/Regular_expressions_1__Special_characters.html" rel="nofollow">http://www.fon.hum.uva.nl/praat/manual/Regular_expressions_1__Special_characters.html</a></p>