Skip to content

Commit 9c12b4c

Browse files
authored
fix(isMobilePhone): update de-DE regex to exclude landline numbers (#1868)
* revert #1391 * remove invalid number blocks
1 parent 667b0bf commit 9c12b4c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const phones = {
2626
'ca-AD': /^(\+376)?[346]\d{5}$/,
2727
'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
2828
'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
29-
'de-DE': /^((\+49|0)[1|3])([0|5][0-45-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,
29+
'de-DE': /^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,
3030
'de-AT': /^(\+43|0)\d{1,4}\d{3,12}$/,
3131
'de-CH': /^(\+41|0)([1-9])\d{1,9}$/,
3232
'de-LU': /^(\+352)?((6\d1)\d{6})$/,

test/validators.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6207,7 +6207,6 @@ describe('Validators', () => {
62076207
locale: 'de-DE',
62086208
valid: [
62096209
'+4915123456789',
6210-
'+4930405044550',
62116210
'015123456789',
62126211
'015123456789',
62136212
'015623456789',
@@ -6218,10 +6217,9 @@ describe('Validators', () => {
62186217
'01631234567',
62196218
'01701234567',
62206219
'017612345678',
6221-
'015345678910',
6222-
'015412345678',
62236220
],
62246221
invalid: [
6222+
'+4930405044550',
62256223
'34412345678',
62266224
'14412345678',
62276225
'16212345678',
@@ -6230,6 +6228,8 @@ describe('Validators', () => {
62306228
'17012345678',
62316229
'+4912345678910',
62326230
'+49015123456789',
6231+
'015345678910',
6232+
'015412345678',
62336233
],
62346234
},
62356235
{

0 commit comments

Comments
 (0)