Skip to content

Commit 12ff904

Browse files
author
shreysinha25
committed
Fix Incorrect Regular Expression for Tajikistan (tg-TJ) in validator.js #2544
1 parent d07eae6 commit 12ff904

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const phones = {
147147
'sq-AL': /^(\+355|0)6[2-9]\d{7}$/,
148148
'sr-RS': /^(\+3816|06)[- \d]{5,9}$/,
149149
'sv-SE': /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,
150-
'tg-TJ': /^(\+?992)?[5][5]\d{7}$/,
150+
'tg-TJ': /^(\+?992|992)?(00|55|88|90|91|92|93|95|98|99)\d{7}$/,
151151
'th-TH': /^(\+66|66|0)\d{9}$/,
152152
'tr-TR': /^(\+?90|0)?5\d{9}$/,
153153
'tk-TM': /^(\+993|993|8)\d{8}$/,

test/validators.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10508,6 +10508,17 @@ describe('Validators', () => {
1050810508
'+992553322551',
1050910509
'992553388551',
1051010510
'992553322551',
10511+
'+992901234567',
10512+
'+992911234567',
10513+
'+992881234567',
10514+
'+992921234567',
10515+
'+992931234567',
10516+
'+992951234567',
10517+
'+992981234567',
10518+
'+992991234567',
10519+
'+992001234567',
10520+
'992901234567',
10521+
'992911234567',
1051110522
],
1051210523
invalid: [
1051310524
'12345',
@@ -10520,6 +10531,9 @@ describe('Validators', () => {
1052010531
'9923633885',
1052110532
'99255363885',
1052210533
'66338855',
10534+
'+992701234567',
10535+
'+9929012345',
10536+
'+99290123456789',
1052310537
],
1052410538
},
1052510539
{

0 commit comments

Comments
 (0)