Canadian/USA Address RegExp

Was thinking of an efficient way of looking for addresses (both Canadian and USA) in web pages, this should work. The only fumble I can see happening is with the street name, as there are so many variations.


The format goes as

Company Name/Person Name (or nothing)
Street Name and Unit Letter or Number (or no unit letter/number)
City and Province/State
Postal Code or Zip code

It could also be an address jammed onto one line

Turns out that there are +4 for Zip Codes (90210-1234). Anyways updated above

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>