Skip to content

Commit

Permalink
fix(isPostalCode): Fix overly permissive BY regexp
Browse files Browse the repository at this point in the history
* add missing start of line anchor
* remove meaningless `{1}` quantifier

Fixes validatorjs#2133
  • Loading branch information
pano9000 committed Dec 19, 2022
1 parent 531dc7f commit 8754507
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/isPostalCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const patterns = {
BE: fourDigit,
BG: fourDigit,
BR: /^\d{5}-\d{3}$/,
BY: /2[1-4]{1}\d{4}$/,
BY: /^2[1-4]\d{4}$/,
CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
CH: fourDigit,
CN: /^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,
Expand Down

0 comments on commit 8754507

Please sign in to comment.