I need a postal address parser for an upcoming project. The user will enter free-form addresses like :
Bob's Warehouse
ATTN: Jim
1234 Main Street
Suite 46 (obviously, optional)
Anytown, AnyState 90210
USA
As well as non-US addresses (as much as possible).
I realize that parsing physical addresses is tedious and often impossible, but I don't need something "perfect". I need reliable code to get address1, address2, city, state/province, zip/postal code, and country and "other" (which would be the 'Bob's Warehouse and ATTN: Jim' parts of the above example) from that blob of text. And reliable and graceful error handling when a problem is run into. This will be user entered free-form text, so lord knows what will come through!