Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Regular Expression for Validating Panamanian Phone Numbers #2434

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const phones = {
'es-PE': /^(\+?51)?9\d{8}$/,
'es-MX': /^(\+?52)?(1|01)?\d{10,11}$/,
'es-NI': /^(\+?505)\d{7,8}$/,
'es-PA': /^(\+?507)\d{7,8}$/,
'es-PA': /^(\+?507)?\s?(?:6\d{3}-?\d{4}|2\d{2}-?\d{4}|2\d{6})$/,
'es-PY': /^(\+?595|0)9[9876]\d{7}$/,
'es-SV': /^(\+?503)?[67]\d{7}$/,
'es-UY': /^(\+598|0)9[1-9][\d]{6}$/,
Expand Down
20 changes: 16 additions & 4 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9231,17 +9231,29 @@ describe('Validators', () => {
{
locale: 'es-PA',
valid: [
'+5076784565',
'+5074321557',
'5073331112',
'+50723431212',
'+507 6784-5685',
'+5076784-5689',
'+50767845549',
'50767845689',
'6995-0543',
'65403820',
'+507 233-1557',
'+507253-6712',
'+5072632312',
'5072810000',
'234-3121',
'2962312',
],
invalid: [
'+50755555',
'+207123456',
'2001236542',
'+507987643254',
'+507jjjghtf',
'+5076784565',
'+5074321557',
'5073331112',
'+5072343121123',
],
},
{
Expand Down
Loading