擅长:python、mysql、java
<p>是另一种情况。检查它前面是否没有“<code>.</code>”,后面是否跟有<a href="http://www.regular-expressions.info/lookaround.html" rel="nofollow">lookarounds</a><code>(?<![.])</code>和{<cd4>}的<code>\w</code></p>
<h3>正则表达式:</h3>
<pre><code>re.search(r'(?<![.\w])Johnny(?:\'s)?[.]?(?![.\w])', string)
</code></pre>