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

Suggestion of the implementation of postal codes validation #455

Open
gabriellopes00 opened this issue Oct 12, 2021 · 2 comments
Open

Suggestion of the implementation of postal codes validation #455

gabriellopes00 opened this issue Oct 12, 2021 · 2 comments

Comments

@gabriellopes00
Copy link

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

I've been thinking in a way of implementing postal code validation. The biggest problem, is that there are a lot of different patterns of postal codes around the world, so isn't possible to create a single regular expression and a unique function to validate it. I found in stack overflow a question asking for an ultimate postal code pattern, and i found this useful answer.
As wee can see, there are around 158 postal code patterns in total, each one referring to a specific region/country in the world.
So here is my suggestion: We could create a map (map[string]string), which the key is the country id (US, CN, FR, BR...), and the value is the regexp for it's postal code (the list might be long). Then, the function to validate the postal code would receive the country id in the first parameter, and the postal code in the second, this way we can find the country id in the map, and see if the received postal code matches with it's respective postal code pattern. What do u think?

Repository owner deleted a comment from sergeyglazyrindev Oct 18, 2021
@sergeyglazyrindev
Copy link

@asaskevich , I sent you a contact request on linkedin.
I really don't understand, seems like you are not in prison in Belarus. And you stopped supporting thisd package -> it's ok, it's not your job. But we need to keep moving. Maybe you are tired from this package. It's ok too. Please reply, don't delete this comment.

@gabriellopes00
Copy link
Author

@asaskevich , I sent you a contact request on linkedin. I really don't understand, seems like you are not in prison in Belarus. And you stopped supporting thisd package -> it's ok, it's not your job. But we need to keep moving. Maybe you are tired from this package. It's ok too. Please reply, don't delete this comment.

I agree, it's ok not to have time to support the package, we understand, but it's been 8 months since we've had updates. There are too many people who use the package and it needs to be maintained.

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

2 participants