 <p>Consider wanting to match the word "march":</p> <pre><code>&gt;&gt;&gt; regex = re.compile(r'\bmarch\b') </code></pre> <p>It can come at the end of the sentence...</p> <pre><code>&gt;&gt;&gt; regex.search('I love march') &lt;_sre.SRE_Match object at 0x10568e4a8&gt; </code></pre> <p>Or the beginning ...</p> <pre><code>&gt;&gt;&gt; regex.search('march is a great month') &lt;_sre.SRE_Match object at 0x10568e440&gt; </code></pre> <p>But if I don't want to match things like <code>marching</code>, word boundaries are the most convenient:</p> <pre><code>&gt;&gt;&gt; regex.search('my favorite pass-time is marching') &gt;&gt;&gt; </code></pre> <p>You might be thinking "But I can get all of these things using <code>r'\s+march\s+'</code>" and you're kind of right... The difference is in what matches. With the <code>\s+</code>, you also might be including some whitespace in the match (since that's what <code>\s+</code> means). This can make certain things like search for a word and replace it more difficult because you might have to manage keeping the whitespace consistent with what it was before.</p>