Hi<br><br>
I have a dictionary with a list of patterns:<br>

<div class="smallfont" style="margin-bottom: 2px;">Code: ( text )</div>
<div class="text" style="margin: 0px; padding: 2px; background: rgb(252, 252, 252) none repeat scroll 0% 50%; color: rgb(34, 34, 34); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<ol><li style="background: rgb(252, 252, 252) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 8pt;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
>>> words = {'sho.':6, '.ilk':8,'.an.':78 }</div></li></ol></div>
 <br>
Where the "." character means any pattern - this can easily be changed to the "*" symbol if need be.<br>
<br>
When the user submits a word, I want to be able to look for a
corresponding pattern (if it exists). For example if the user said
"show" or "shoe", then the value 6 would be returned. If it was "band",
"land", "sand", "pant" etc then 78 would be returned - but not "pants"
as it is longer than the pattern. <br>
<br>
I know the normal way is to provide the reg exp and search the dictionary with it, but this is the other way round :(<br>
<br>
Thanks