You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
@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.
@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.
Feature Request
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?The text was updated successfully, but these errors were encountered: