Skip to content

Commit

Permalink
fix(isMobilePhone): update regex for de-DE (#1391)
Browse files Browse the repository at this point in the history
fixes #1378
  • Loading branch information
heanzyzabala authored Jul 25, 2020
1 parent 9207b04 commit f67a57f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const phones = {
'bn-BD': /^(\+?880|0)1[13456789][0-9]{8}$/,
'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
'de-DE': /^(\+49)?0?1(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7}$/,
'de-DE': /^(\+49)?0?[1|3]([0|5][0-45-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7}$/,
'de-AT': /^(\+43|0)\d{1,4}\d{3,12}$/,
'de-CH': /^(\+41|0)(7[5-9])\d{1,7}$/,
'el-GR': /^(\+?30|0)?(69\d{8})$/,
Expand Down
8 changes: 5 additions & 3 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -5155,6 +5155,7 @@ describe('Validators', () => {
valid: [
'+49015123456789',
'+4915123456789',
'+4930405044550',
'015123456789',
'15123456789',
'15623456789',
Expand All @@ -5165,15 +5166,16 @@ describe('Validators', () => {
'1631234567',
'1701234567',
'17612345678',
],
invalid: [
'15345678910',
'15412345678',
],
invalid: [
'34412345678',
'14412345678',
'16212345678',
'1761234567',
'16412345678',
'17012345678',
'12345678910',
'+4912345678910',
],
},
Expand Down

0 comments on commit f67a57f

Please sign in to comment.