擅长:python、mysql、java
<p>因为您没有指定要检查匹配字符串的哪一部分,所以我包含了更多的组。你知道吗</p>
<pre><code>import re
s = 'hello there estabilidade this is just some text (yes it is)'
r = re.search(r"(estabilidade([.\S]+))\(", s)
print(r.group(1)) # "estabilidade this is just some text"
print(r.group(2)) # " this is just some text"
</code></pre>