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

Implement PhoneNumberMatcher for regional contexts #179

Closed
wants to merge 2 commits into from

Conversation

SamiKammoun
Copy link

@SamiKammoun SamiKammoun commented Jul 26, 2024

Implementation for PhoneNumberMatcher that supports regional phone number validations. The main functionality is encapsulated in the NewPhoneNumberMatcherForRegion function, which efficiently identifies and validates phone numbers within a given textual sequence based on specified regional criteria.

Key Features:

  • Regional phone number parsing and validation.
  • Phone number parsing and validation for unknown regions.

My implementation is a bit verbose and may make unnecessary extractions. Making it less verbose always led me to make some sacrifices. I left it to the user to define his own level of leniency instead.

@rowanseymour
Copy link
Member

Hi @SamiKammoun can you link to equivalent functionality in libphonenumber so we can compare?

@SamiKammoun
Copy link
Author

I don't know if this fork should follow the Java implementation.
I found this and it's not even close to what I have done 🙄
However, I found out that another open PR #89 has a similar implementation. It wasn't merged because it is a breaking change.
Do I have to implement the same logic? or can we just make PR #89 non breaking ?

@rowanseymour
Copy link
Member

Unfortunately the aim of this library is to be a strict port of libphonenumber so we only accept code changes to keep us up to date with code changes in libphonenumber. I've updated the README to clarify this.

@SamiKammoun
Copy link
Author

I can see that. Closing that PR for now.

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.

2 participants