From be0e08823b1a19d90861e5af1e04abcf634c2e9c Mon Sep 17 00:00:00 2001 From: amralaa10 Date: Thu, 28 Mar 2019 11:24:56 +0200 Subject: [PATCH 1/4] add support for eg 015 phones --- src/lib/isMobilePhone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index 1f5481fc7..2e4fe74d3 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -4,7 +4,7 @@ import assertString from './util/assertString'; const phones = { 'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/, 'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/, - 'ar-EG': /^((\+?20)|0)?1[012]\d{8}$/, + 'ar-EG': /^((\+?20)|0)?1[0125]\d{8}$/, 'ar-IQ': /^(\+?964|0)?7[0-9]\d{8}$/, 'ar-JO': /^(\+?962|0)?7[789]\d{7}$/, 'ar-KW': /^(\+?965)[569]\d{7}$/, From 9c6cf9c5bfadbdcc42b8868797a4838fbfa1b219 Mon Sep 17 00:00:00 2001 From: amralaa10 Date: Wed, 10 Apr 2019 17:18:09 +0200 Subject: [PATCH 2/4] added test cases for phone number validations --- test/validators.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/validators.js b/test/validators.js index 61ffbe479..ae2fdcc8d 100644 --- a/test/validators.js +++ b/test/validators.js @@ -3380,8 +3380,12 @@ describe('Validators', () => { '+201274652177', '+201280134679', '+201090124576', + '+201583728900', + '293994955996', '201090124576', '01090124576', + '01538920744', + '15930759937', '1090124576', ], invalid: [ From ede0a1bda4dce389d377b39171be21fa541598b5 Mon Sep 17 00:00:00 2001 From: amralaa10 Date: Wed, 10 Apr 2019 17:26:24 +0200 Subject: [PATCH 3/4] fix failing test case --- test/validators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validators.js b/test/validators.js index ae2fdcc8d..f3caa024f 100644 --- a/test/validators.js +++ b/test/validators.js @@ -3381,7 +3381,7 @@ describe('Validators', () => { '+201280134679', '+201090124576', '+201583728900', - '293994955996', + '201599495596', '201090124576', '01090124576', '01538920744', From b1594623c8b81402b1580a7cae1aa84426b0c3ac Mon Sep 17 00:00:00 2001 From: amralaa10 Date: Wed, 10 Apr 2019 17:30:33 +0200 Subject: [PATCH 4/4] fix another failed test case --- test/validators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validators.js b/test/validators.js index f3caa024f..dabe88cb3 100644 --- a/test/validators.js +++ b/test/validators.js @@ -3385,7 +3385,7 @@ describe('Validators', () => { '201090124576', '01090124576', '01538920744', - '15930759937', + '1593075993', '1090124576', ], invalid: [