\b in python's re and exact word match
<p>How to make \b properly respect the word boundary? For example, understand the ' and not does partial match... </p>

<pre><code>&gt;&gt;&gt; import re
&gt;&gt;&gt; str = "This is a test's test"
&gt;&gt;&gt; p1 = r'\b' + 'test' + r'\b'
&gt;&gt;&gt; re.findall(p1,str)
['test', 'test']
</code></pre>