擅长:python、mysql、java
<p>使用先行而不是后视:</p>
<pre><code>myDF.pet.str.extract('(?P<bunny>(?<=/)(?!jack).*rabbit)', expand=True)
bunny
0 NaN
1 rabbit
2 small fluffy rabbit
3 lop-eared rabbit
4 many rabbit
5 NaN
</code></pre>
<p/>
^{pr2}$
<p>这里,否定的lookahead意味着正斜杠后面不能跟“jack”。在</p>