diff --git a/src/lib/isPostalCode.js b/src/lib/isPostalCode.js index 3dbaab1be..1d8e615da 100644 --- a/src/lib/isPostalCode.js +++ b/src/lib/isPostalCode.js @@ -35,6 +35,7 @@ const patterns = { IE: /^(?!.*(?:o))[A-z]\d[\dw]\s\w{4}$/i, IL: /^(\d{5}|\d{7})$/, IN: /^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/, + IR: /\b(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}\b/, IS: threeDigit, IT: fiveDigit, JP: /^\d{3}\-\d{4}$/, diff --git a/test/validators.js b/test/validators.js index bf8cb515e..c55b06fd8 100644 --- a/test/validators.js +++ b/test/validators.js @@ -8863,6 +8863,18 @@ describe('Validators', () => { '1000', ], }, + { + locale: 'IR', + valid: [ + '4351666456', + '5614736867', + ], + invalid: [ + '43516 6456', + '123443516 6456', + '891123', + ], + }, { locale: 'CZ', valid: [