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

Conversation

Nauj-Montes
Copy link

@Nauj-Montes Nauj-Montes commented Jul 25, 2024

To resolve the issue #2433, the regular expression was be updated to:

"es-PA": /^(\+?507)?\s?(?:6\d{3}-?\d{4}|2\d{2}-?\d{4}|2\d{6})$/

Benefits of the Updated Regex:

  • Correct Country Code Handling: Properly matches the optional +507 at the start.
  • Accurate Length Validation: Ensures numbers have the correct digit count based on their type (landline or mobile).
  • Prefix Validation: Validates the starting digits to distinguish between landline and mobile numbers.
  • Hyphen Flexibility: Allows optional hyphens in mobile numbers, ensuring formats like +507 6123-4567 are valid.

Signed-off-by: Juan Montes [email protected]

Copy link
Author

@Nauj-Montes Nauj-Montes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I accidentally put initial and ending quotes to the regular expression, already fixed.

@rubiin
Copy link
Member

rubiin commented Aug 25, 2024

@Nauj-Montes also add source for the update

@Nauj-Montes
Copy link
Author

@Nauj-Montes also add source for the update

That means that I have to put the reference from which new changes are based on, right?
I think I did at the beginning #2433

@rubiin
Copy link
Member

rubiin commented Aug 25, 2024

Yeah . Source like a wikipedia entry or perhaps a webpage would be good. Will be helpful for review

@pano9000
Copy link
Contributor

pano9000 commented Sep 4, 2024

thanks for the PR.
Kindly notice my comment in #2433 - I personally don't think this PR should be merged for these reasons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants