擅长:python、mysql、java
<p>参考<a href="https://docs.python.org/3/library/re.html" rel="nofollow noreferrer">https://docs.python.org/3/library/re.html</a></p>
<pre><code>>>> print(re.findall("device=(\\'[A-Z]:\\\\')", _text))
["'D:\\'"]
</code></pre>
<p>您可能需要将*替换为[A-Z]。我想驱动器号是大写的,否则就用[A-Za-z]</p>