擅长:python、mysql、java
<p>您可以使用此基于lookahead的regex:</p>
<pre><code>>>> print re.findall(r"'''(?:(?!''').)*''' is a \[\[.*?\]\]", line)
["'''starter culture''' is a [[microbiological culture]]"]
</code></pre>
<p><code>(?:(?!''').)*</code>将匹配0个或多个在下一个位置没有<code>'''</code>的字符,因此要确保匹配两个<code>'''</code></strong>之间的最短匹配。在</p>
<p><a href="https://regex101.com/r/pV1hZ3/1" rel="nofollow">RegEx Demo</a></p>