-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wish: postal code support #2
Comments
+1 |
I've made a start on this, so if you can hit me with some sample addresses (including zip code) for writing some tests that would be awesome. Ideally, I'm after a set of addresses that show the various different zip codes that are implemented in the US. From a quick read of the stack overflow question and answer below, I can see there are a few different variations used across the US so it would be good to capture each of those: http://stackoverflow.com/questions/2577236/regex-for-zip-code |
Thanks. There is an open source postal code regex project here in ::zip : http://search.cpan.org/~abigail/Regexp-Common-2013031301/ You can also follow the Browse link and look in ./t/zip/ ...for tests. In the US, a zipcode must be exactly 5 digits or 5 a dash and exactly 4 On Wednesday, April 16, 2014, Damon Oehlman [email protected]
|
@markstos Sweet thanks :) |
To specifically answer your question about US postal codes. There are only two valid formats: 5 digits and 5 digits followed a dash and then 4 more digits. Some of the 5 digit zipcodes start with a leading zero. Sometimes when these get run through a spreadsheet import/export, the leading zeros get lost. No one ever writes one this way, but I've seen it happen when computers process them. So be clear, while it's a zipcode is 5 digits, it should be treated as a string, not a number, which might cause the leading zero to disappear. |
I'm interested in getting the "postal code" broken out into its own string. I realize they vary around the world, but there is already some region-specific code in there with the "EN" parser.
While postal code formats vary some around the world, it is fairly common that they are present in address strings.
Thanks,
The text was updated successfully, but these errors were encountered: