擅长:python、mysql、java
<pre><code>In [52]: myDF['pet'].str.extract(r'/(?P<bunny>(?!jack).*rabbits?.*)',expand=True)
Out[52]:
bunny
0 NaN
1 rabbit
2 small fluffy rabbit
3 lop-eared rabbit
4 many rabbits
5 NaN
</code></pre>
<p><a href="https://regex101.com/r/4RMdqS/1/" rel="nofollow noreferrer">RegEx explained ...</a></p>