Skip to content

Commit c3f0187

Browse files
Theta-Devtheteladras
authored andcommitted
fix: Russian passport number regex (validatorjs#1810)
* fix: Russian passport number regex fixes validatorjs#1807
1 parent d20ca5c commit c3f0187

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/lib/isPassportNumber.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const passportRegexByCountryCode = {
5050
PL: /^[A-Z]{2}\d{7}$/, // POLAND
5151
PT: /^[A-Z]\d{6}$/, // PORTUGAL
5252
RO: /^\d{8,9}$/, // ROMANIA
53-
RU: /^\d{2}\d{2}\d{6}$/, // RUSSIAN FEDERATION
53+
RU: /^\d{9}$/, // RUSSIAN FEDERATION
5454
SE: /^\d{8}$/, // SWEDEN
5555
SL: /^(P)[A-Z]\d{7}$/, // SLOVANIA
5656
SK: /^[0-9A-Z]\d{7}$/, // SLOVAKIA

test/validators.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3078,14 +3078,16 @@ describe('Validators', () => {
30783078
validator: 'isPassportNumber',
30793079
args: ['RU'],
30803080
valid: [
3081-
'26 32 636829',
3082-
'0121 345321',
3083-
'4398636928',
3081+
'2 32 636829',
3082+
'012 345321',
3083+
'439863692',
30843084
],
30853085
invalid: [
3086-
'AZ 2R YU46J',
3087-
'012A 3D5321',
3088-
'SF233D532T',
3086+
'A 2R YU46J0',
3087+
'01A 3D5321',
3088+
'SF233D53T',
3089+
'12345678',
3090+
'1234567890',
30893091
],
30903092
});
30913093

0 commit comments

Comments
 (0)