Skip to content

Commit

Permalink
fix: Russian passport number regex (#1810)
Browse files Browse the repository at this point in the history
* fix: Russian passport number regex

fixes #1807
  • Loading branch information
Theta-Dev authored and profnandaa committed Oct 31, 2021
1 parent 9c2dfd5 commit 00a3d29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/isPassportNumber.js
Expand Up @@ -50,7 +50,7 @@ const passportRegexByCountryCode = {
PL: /^[A-Z]{2}\d{7}$/, // POLAND
PT: /^[A-Z]\d{6}$/, // PORTUGAL
RO: /^\d{8,9}$/, // ROMANIA
RU: /^\d{2}\d{2}\d{6}$/, // RUSSIAN FEDERATION
RU: /^\d{9}$/, // RUSSIAN FEDERATION
SE: /^\d{8}$/, // SWEDEN
SL: /^(P)[A-Z]\d{7}$/, // SLOVANIA
SK: /^[0-9A-Z]\d{7}$/, // SLOVAKIA
Expand Down
14 changes: 8 additions & 6 deletions test/validators.js
Expand Up @@ -3078,14 +3078,16 @@ describe('Validators', () => {
validator: 'isPassportNumber',
args: ['RU'],
valid: [
'26 32 636829',
'0121 345321',
'4398636928',
'2 32 636829',
'012 345321',
'439863692',
],
invalid: [
'AZ 2R YU46J',
'012A 3D5321',
'SF233D532T',
'A 2R YU46J0',
'01A 3D5321',
'SF233D53T',
'12345678',
'1234567890',
],
});

Expand Down

0 comments on commit 00a3d29

Please sign in to comment.