擅长:python、mysql、java
<p>你也可以检查一下</p>
<pre><code>import re
s = '(some text) or ((other text) and (some more text)) and (still more text)'
find_string = re.findall(r'[(]{2}[a-z\s()]*[)]{2}|[(][a-z\s]*[)]', s)
print(find_string)
</code></pre>
<p>输出:</p>
<pre><code>['(some text)', '((other text) and (some more text))', '(still more text)']
</code></pre>
<p><strong>编辑</p>
<pre><code>find_string = re.findall(r'[(\s]{2}[a-z\s()]*[)\s]{2}|[(][a-z\s]*[)]', s)
</code></pre>