matching a street address with regular expressions
Andy Cheesman
Andy.cheesman at bristol.ac.uk
Thu Oct 11 09:43:23 EDT 2007
Check out kodos http://kodos.sourceforge.net/ for an interactive python
regexp tester
Andy
Goldfish wrote:
> Don't forget to write test cases. If you have a series of addresses,
> and confirm they are parsed correctly, you are in a good position to
> refine the pattern. You will instantly know if a change in pattern has
> broken another pattern.
>
> The reason I'm saying this, is because I think your pattern is
> incomplete. I suggest you add a test case for the following street
> address:
>
> 221B Baker Street
>
> That is a real address in London (only Sherlock Holmes) was fiction. I
> know it, because I actually visited the location. Can you address
> matching pattern handle that? Just don't break other address
> recognition test cases while fixing things.
>
More information about the Python-list
mailing list