-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
IsMobilePhone.js - Update Regular Expression for Validating Panamanian Phone Numbers #2433
Comments
Please assign this issue to me |
@VanshajTiwari I don't have the necessary permissions to assign issues. |
the validator is called So me personally, would regard this as a non-issue. if we need support for landline numbers, maybe there should be a new validator called but that is worth another issue |
@Nauj-Montes @pano9000 is this issue valid if yes can i work on it |
@pano9000 @ShreySinha02 I understand landline numbers should't be verified, even taking out landline numbers validation, the existent validation on |
@Nauj-Montes @pano9000 Hey, Can I work on this |
Description
The current regular expression used for validating Panamanian phone numbers is flawed and needs updating to accurately match the expected formats for both landline and mobile numbers. The existing regex is as follows:
Problems with the Current Regex
Inaccurate Length Validation: The regex matches 7 or 8 digits after the country code, but does not account for the specific length requirements of Panamanian numbers:
507
prefix.507
prefix, optionally formatted with a hyphen (e.g.,6XXX-XXXX
).Lack of Prefix Validation: The regex does not enforce valid starting digits:
2
.6
.This is a problem because it allows matches such as
+50712345678
which shouldn't be valid as shown in the next screenshot.+507 6123-4567
to be incorrectly flagged as invalid as shown in the following screenshot:Action Required
The text was updated successfully, but these errors were encountered: