Skip to content

Commit 72573b3

Browse files
WardKhaddourrubiin
andauthored
Add Qatar phone number validation (#2556)
Co-authored-by: Rubin Bhandari <[email protected]>
1 parent 243f6c5 commit 72573b3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const phones = {
2020
'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
2121
'ar-TN': /^(\+?216)?[2459]\d{7}$/,
2222
'az-AZ': /^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,
23+
'ar-QA': /^(\+?974|0)?([3567]\d{7})$/,
2324
'bs-BA': /^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,
2425
'be-BY': /^(\+?375)?(24|25|29|33|44)\d{7}$/,
2526
'bg-BG': /^(\+?359|0)?8[789]\d{7}$/,

test/validators.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10688,6 +10688,11 @@ describe('Validators', () => {
1068810688
'80912345',
1068910689
],
1069010690
},
10691+
{
10692+
locale: 'ar-QA',
10693+
valid: ['+97435551234', '+97455551234', '+97465551234', '+97475551234', '35551234', '55551234', '65551234', '75551234'],
10694+
invalid: ['+97445551234', '+97405551234', '+9745555123', '+974555512345', '+97355551234', '+9125551234', '25551234', '+13005551234', '45551234', '95551234', '+9745555abcd', '', '+974'],
10695+
},
1069110696
];
1069210697

1069310698
let allValid = [];

0 commit comments

Comments
 (0)