擅长:python、mysql、java
<p>使用<a href="http://docs.python.org/library/re.html#re.search" rel="noreferrer">^{<cd1>}</a>:</p>
<pre><code>>>> import re
>>> s1 = "thishasadigit4here"
>>> m = re.search(r"\d", s1)
>>> if m is not None:
... print("Digit found at position", m.start())
... else:
... print("No digit in that string")
...
Digit found at position 13
</code></pre>