擅长:python、mysql、java
<p>组<code>(.*)</code>在其捕获中包含右引号。请尝试以下操作:</p>
<pre><code>>>> re.findall(r'data-rlocation="([^"]*)"', contents)
['Uttam Nagar East']
</code></pre>
<p>看看它是如何工作的<a href="https://regex101.com/r/uN5UsB/1" rel="nofollow noreferrer">here</a>。你知道吗</p>