擅长:python、mysql、java
<p>我想把你的问题表述为:</p>
<pre><code>str = 'This is statute 2913.42 and defendant PLD GLTY, This is statute 2913.405 and defendant at pre-trial PLD GLTY, This is statute 2913.44 without any plea of guilt'
matches = re.findall(r'\b\d+(?:\.\d+)?(?=[^\d]+\bPLD GLTY)', str)
print(matches)
</code></pre>
<p>这张照片是:</p>
<pre><code>['2913.42', '2913.405']
</code></pre>
<p>正则表达式逻辑要求找到每个具有属性的十进制数,我们可以向前看<em>,而不必看到另一个数字,然后在字符串的后面某处找到文本<code>PLD GLTY</code></p>