Skip to content

Commit f67a57f

Browse files
authored
fix(isMobilePhone): update regex for de-DE (#1391)
fixes #1378
1 parent 9207b04 commit f67a57f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const phones = {
2020
'bn-BD': /^(\+?880|0)1[13456789][0-9]{8}$/,
2121
'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
2222
'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
23-
'de-DE': /^(\+49)?0?1(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7}$/,
23+
'de-DE': /^(\+49)?0?[1|3]([0|5][0-45-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7}$/,
2424
'de-AT': /^(\+43|0)\d{1,4}\d{3,12}$/,
2525
'de-CH': /^(\+41|0)(7[5-9])\d{1,7}$/,
2626
'el-GR': /^(\+?30|0)?(69\d{8})$/,

test/validators.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5155,6 +5155,7 @@ describe('Validators', () => {
51555155
valid: [
51565156
'+49015123456789',
51575157
'+4915123456789',
5158+
'+4930405044550',
51585159
'015123456789',
51595160
'15123456789',
51605161
'15623456789',
@@ -5165,15 +5166,16 @@ describe('Validators', () => {
51655166
'1631234567',
51665167
'1701234567',
51675168
'17612345678',
5168-
],
5169-
invalid: [
51705169
'15345678910',
51715170
'15412345678',
5171+
],
5172+
invalid: [
5173+
'34412345678',
5174+
'14412345678',
51725175
'16212345678',
51735176
'1761234567',
51745177
'16412345678',
51755178
'17012345678',
5176-
'12345678910',
51775179
'+4912345678910',
51785180
],
51795181
},

0 commit comments

Comments
 (0)