Skip to content

Add support for Kenya's new 01 mobile number format #75

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

Francis-Yuppie
Copy link

Description:
This PR updates the Kenya phone number metadata to support the newly introduced 01 prefix for mobile numbers, while maintaining existing support for 07 and +254 formats.

Changes made:

  1. Modified phonenumber_metadata_KE.php to:
    • Add 01\d to the mobile NationalNumberPattern
    • Update generalDesc pattern to include the new format
    • Maintain all existing validation rules and number lengths

Reason for changes:

  • Kenya has introduced new mobile numbers starting with 01
  • Current validation rejects these valid numbers
  • The change ensures backward compatibility while adding new format support

Testing:
The updated pattern validates:

  • Existing formats: 07XXXXXXXX, 7XXXXXXXX, +2547XXXXXXXX
  • New formats: 01XXXXXXXX, +2541XXXXXXXX
  • Maintains 9-digit length requirement

- Updated NationalNumberPattern in mobile section to include 01\d
- Modified generalDesc pattern to recognize 01 prefix
- Maintained backward compatibility with existing 07/+254 formats
- Keeps 9-digit length requirement for all mobile numbers
@Francis-Yuppie
Copy link
Author

Description

Adds support for Kenya's newly introduced 01 mobile number prefix while maintaining backward compatibility with existing 07/+254 formats.

Changes Made

  • Updated phonenumber_metadata_KE.php to:
    • Include 01\d in mobile NationalNumberPattern
    • Modified generalDesc pattern
    • Maintained all existing validation rules

Testing

Verified with:

  • Valid: 0712345678, 0112345678, +254112345678
  • Invalid: 0012345678 (double zero), 0212345678 (wrong prefix)

@Francis-Yuppie
Copy link
Author

pr request

@Borales
Copy link
Owner

Borales commented Apr 27, 2025

@Francis-Yuppie there's too many unrelated files in this PR

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