擅长:python、mysql、java
<p>星形运算符(<code>*</code>)表示<strong>零次或多次重复</strong>。你的字符串没有英文字母的重复,因为它完全是数字,这是完全有效的使用星号(重复零次)。而是使用<code>+</code>运算符,它表示<strong>一个或多个</strong>重复。示例:</p>
<pre><code>>>> n = "3534543234543"
>>> r1 = re.compile("[a-zA-Z]*")
>>> r1.match(n)
<_sre.SRE_Match object at 0x07D85720>
>>> r2 = re.compile("[a-zA-Z]+") #using the + operator to make sure we have at least one letter
>>> r2.match(n)
</code></pre>
<p><a href="http://www.regular-expressions.info/repeat.html">Helpful link on repetition operators.</a></p>