What is word boundary while using regex in python
<p>What is word boundary in python .Can someone please explain this with examples,</p>

<p>Example:1</p>

<pre><code>&gt;&gt;&gt; x = '456one two three123'
&gt;&gt;&gt; y=re.search(r"\btwo\b",x)
&gt;&gt;&gt; y
&lt;_sre.SRE_Match object at 0x2aaaaab47d30&gt;
</code></pre>

<p>Example:2</p>

<pre><code>&gt;&gt;&gt; y=re.search(r"two",x)
&gt;&gt;&gt; y
&lt;_sre.SRE_Match object at 0x2aaaaab47d30&gt;
</code></pre>

<p>Example3:</p>

<pre><code>&gt;&gt;&gt; ip="192.168.254.1234"
&gt;&gt;&gt; if re.search(r"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b",ip):
...    print ip
...
</code></pre>

<p>Example4:</p>

<pre><code>&gt;&gt;&gt; ip="192.168.254.1234"
&gt;&gt;&gt; if re.search(r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}",ip):
...    print ip
192.168.254.1234
</code></pre>
