Skip to content
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

Open
markstos opened this issue Apr 1, 2014 · 5 comments
Open

wish: postal code support #2

markstos opened this issue Apr 1, 2014 · 5 comments
Assignees

Comments

@markstos
Copy link
Collaborator

markstos commented Apr 1, 2014

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,

@dominicbarnes
Copy link

+1

@DamonOehlman
Copy link
Owner

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

@DamonOehlman DamonOehlman self-assigned this Apr 16, 2014
@markstos
Copy link
Collaborator Author

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
more digits.

On Wednesday, April 16, 2014, Damon Oehlman [email protected]
wrote:

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

Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-40660533
.

Mark Stosberg
Senior Systems Engineer
RideAmigos

@DamonOehlman
Copy link
Owner

@markstos Sweet thanks :)

@markstos
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants