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

isPostalCode: Belarus (BY) RegExp is too permissive, matches invalid postal codes #2133

Closed
pano9000 opened this issue Dec 19, 2022 · 0 comments · Fixed by #2134
Closed

isPostalCode: Belarus (BY) RegExp is too permissive, matches invalid postal codes #2133

pano9000 opened this issue Dec 19, 2022 · 0 comments · Fixed by #2134
Labels

Comments

@pano9000
Copy link
Contributor

pano9000 commented Dec 19, 2022

The current regexp is too permissive, so it will match strings that should not be valid postal codes.
THis is caused by a missing "Start of String" anchor in the current Regexp:

/2[1-4]{1}\d{4}$/

PR with a fix is coming in a few moments

pano9000 added a commit to pano9000/validator.js that referenced this issue Dec 19, 2022
* add missing start of line anchor
* remove meaningless `{1}` quantifier

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

Successfully merging a pull request may close this issue.

1 participant