matching a street address with regular expressions

Andy Cheesman Andy.cheesman at
Thu Oct 11 15:43:23 CEST 2007

Check out kodos for an interactive python
regexp tester


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