Skip to content

fix(isMobilePhone): correct regex for Tajikistan (tg-TJ) phone numbers #2545

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

army003
Copy link

@army003 army003 commented Apr 2, 2025

This PR updates the regular expression for Tajikistan (tg-TJ) phone numbers in isMobilePhone. The previous regex did not fully cover valid mobile number prefixes and incorrectly allowed some invalid numbers.

Updating the regex to match valid Tajikistan mobile phone prefixes.
Adding new valid and invalid test cases to improve accuracy.

https://lca.logcluster.org/34-tajikistan-telecommunications
(part with Cellular Companies)

Checklist

  • [+ ] PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • [+ ] Tests written (where applicable)
  • [ +] References provided in PR (where applicable)

@WikiRik
Copy link
Member

WikiRik commented Apr 2, 2025

I'm having issues with validating the regex. The old one is indeed incorrect, but I'm unsure what the new one should be.
The source you mentioned, says nothing about 00 for example.
Other sources I've referenced are the National Numbering Plan submitted at the ITU and Google's libphonenumber

Preferably I would use the source from the ITU or from the website of the government agency responsible for the phone numbers.

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