In Python, How do you prevent partial matches using re.search if you are using a dictionary key as your pattern
<p>How do you prevent parital matches while using re.search if you are using a dictionary key as your pattern in Python.  For this question I would like to avoid iterating through the nested list in the dictionary value.  I've tried appending regular expressions to the search pattern but it results in error.</p>

<p>Partial Match:</p>

<pre><code>&gt;&gt;&gt; d
{'server': '192.168.1.1, 192.168.1.22, 192.168.1.2'}

&gt;&gt;&gt; e
'192.168.1'

&gt;&gt;&gt; match = re.search(e, d['server'])

&gt;&gt;&gt; if match:
...   print match.group()
...
192.168.1
</code></pre>
