On Sat, May 15, 2010 at 9:32 PM, timo verbeek <span dir="ltr"><<a href="mailto:timoverbeek10@gmail.com">timoverbeek10@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

On May 15, 1:02 pm, timo verbeek <<a href="mailto:timoverbee...@gmail.com">timoverbee...@gmail.com</a>> wrote:<br>
Place starts always with for<br></blockquote><div><br>Okay, much better.<br><br>Given that constraint, it looks like regular expression can do the job. I'm not very experienced with regex, though.<br><br><span style="font-family: courier new,monospace;">\w*</span> matches a whole word composed of letters and numbers by default.<br>

<br><span style="font-family: courier new,monospace;">>>> result = re.search('for \w*', 'Give me the weather for London please.')</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">>>> result.group()</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">'for London'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">>>> result.group().split()[1]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">'London'</span><br><br>Cheers,<br>Xav<br></div></div>