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

feat(isMobilePhone): update phone regex for Cameroon fr-CM #2454

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

Conversation

2p4b
Copy link

@2p4b 2p4b commented Sep 16, 2024

update phone regex to match both mobile and fix IDS numbers for Cameroon fr-CM

Checklist

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

Read more

@rubiin rubiin requested review from WikiRik and pano9000 September 18, 2024 14:28
@@ -100,7 +100,7 @@ const phones = {
'fr-BF': /^(\+226|0)[67]\d{7}$/,
'fr-BJ': /^(\+229)\d{8}$/,
'fr-CD': /^(\+?243|0)?(8|9)\d{8}$/,
'fr-CM': /^(\+?237)6[0-9]{8}$/,
'fr-CM': /^(\+?237)(6|2)[0-9]{8}$/,
Copy link
Member

Choose a reason for hiding this comment

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

This change is not needed as far as I can see. A number starting with 2 is not for mobile phone numbers, only fixed numbers (which we don't validate here). We can improve this regular expression to make it more strict though.

The latest ITU information (which is my primary source) is from 2014, so it might be outdated;
https://www.itu.int/oth/T0202000024/en

Copy link
Author

Choose a reason for hiding this comment

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

I had some work done for a client with a modem who's number started with 2. The modem uses LTE for connectivity so would that be a fixed or mobile classification?

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