擅长:python、mysql、java
<p>试试看</p>
<pre><code>re.search(r'\bis\b', your_string)
</code></pre>
<p>来自<a href="http://docs.python.org/2/library/re.html" rel="noreferrer">the docs</a>:</p>
<blockquote>
<p>\b Matches the empty string, but only at the beginning or end of a word. </p>
</blockquote>
<p>注意,<code>re</code>模块使用“word”的简单定义作为“字母数字或下划线字符序列”,其中“字母数字”取决于语言环境或unicode选项。</p>
<p>还要注意,如果没有原始字符串前缀,<code>\b</code>将被视为“backspace”,而不是regex单词边界。</p>