Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixes #1761 for Bangladesh and Myanmar Mobile Validation and Test
  • Loading branch information
ferdousulhaque committed Oct 19, 2021
commit 31a7dfefefdee4f27004344b1edba1aed1c30d11
3 changes: 2 additions & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const phones = {
'bs-BA': /^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,
'be-BY': /^(\+?375)?(24|25|29|33|44)\d{7}$/,
'bg-BG': /^(\+?359|0)?8[789]\d{7}$/,
'bn-BD': /^(\+?880|0)1[13456789][0-9]{8}$/,
'bn-BD': /^(\+?880|0)1[1356789][0-9]{8}$/,
'ca-AD': /^(\+376)?[346]\d{5}$/,
'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}$/,
Expand Down Expand Up @@ -91,6 +91,7 @@ const phones = {
'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
'lt-LT': /^(\+370|8)\d{8}$/,
'lv-LV': /^(\+?371)2\d{7}$/,
'mm-mmr': /^(\+?959|09|9)(2[5-7]|4[0-5]|7[6-9]|9[6-9]|7[4-9]|6[6-9]|3[1-2]})[0-9]{7}$/,
'ms-MY': /^(\+?6?01){1}(([0145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,
'mz-MZ': /^(\+?258)?8[234567]\d{7}$/,
'nb-NO': /^(\+?47)?[49]\d{7}$/,
Expand Down
18 changes: 17 additions & 1 deletion test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -5882,14 +5882,14 @@ describe('Validators', () => {
'01717112029',
'8801898765432',
'+8801312345678',
'01494676946',
],
invalid: [
'',
'0174626346',
'017943563469',
'18001234567',
'0131234567',
'01494676946',
],
},
{
Expand Down Expand Up @@ -7946,6 +7946,22 @@ describe('Validators', () => {
'NotANumber',
],
},
{
locale: 'mm-mmr',
valid: [
'+959750202595',
'09750202595',
'9750202595',
'+959260000966',
],
invalid: [
'59750202595',
'+9597502025',
'08943234524',
'09950000966',
'959240000966',
],
},
];

let allValid = [];
Expand Down