matching a street address with regular expressions

Goldfish gregturn at mindspring.com
Thu Oct 11 09:25:38 EDT 2007


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