Skip to content

Commit ccd4647

Browse files
committed
fix:refined regex for all mk numbers
1 parent aa5a410 commit ccd4647

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const phones = {
160160
'ar-YE': /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,
161161
'ar-EH': /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,
162162
'fa-AF': /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/,
163-
'mk-MK': /^(\+?389|0)?[2-8]\d{7}$/,
163+
'mk-MK': /^(\+?389|0)?((?:2[2-9]\d{6}|(?:3[1-4]|4[2-8])\d{6}|500\d{5}|5[2-9]\d{6}|7[0-9][2-9]\d{5}|8[1-9]\d{6}|800\d{5}|8009\d{4}))$/,
164164
};
165165
/* eslint-enable max-len */
166166

test/validators.test.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10733,24 +10733,29 @@ describe('Validators', () => {
1073310733
{
1073410734
locale: 'mk-MK',
1073510735
valid: [
10736-
'+38921234567',
10737-
'+38971234567',
10736+
'+38923234567',
1073810737
'38931234567',
10739-
'38961234567',
10740-
'21234567',
10738+
'022123456',
10739+
'22234567',
1074110740
'71234567',
1074210741
'31234567',
1074310742
'+38923091500',
10743+
'80091234',
10744+
'81123456',
10745+
'54123456',
1074410746
],
1074510747
invalid: [
1074610748
'38912345678',
1074710749
'+389123456789',
10748-
'2123456',
10750+
'21234567',
1074910751
'123456789',
1075010752
'+3891234567',
10753+
'700012345',
10754+
'510123456',
1075110755
'This should fail',
1075210756
'+389123456',
1075310757
'389123456',
10758+
'80912345',
1075410759
],
1075510760
},
1075610761
];

0 commit comments

Comments
 (0)