擅长:python、mysql、java
<p>根据第四只鸟的回答,但有点扭曲。<s> 通过使用非捕获组,您可以避免在“Build Number”和“perforce”之间有一个非捕获组。</s>这样,您就只需要为显式想要的目标设置regex。你知道吗</p>
<pre class="lang-py prettyprint-override"><code>r"Version:\s*(.*)\n|Build Number:\s*(.*)\n|perforce_url:\s*(.*)\n"
</code></pre>
<p><a href="https://regex101.com/r/JyRzbF/3" rel="nofollow noreferrer">regex</a></p>
<p>编辑:不需要围绕“版本”、“构建”等实现非捕获组</p>