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

IsMobilePhone.js - Update Regular Expression for Validating Israeli (he-IL) mobile number [Urgent as issue in production] #2503

Open
b2rpt opened this issue Nov 27, 2024 · 1 comment · May be fixed by #2507
Labels

Comments

@b2rpt
Copy link

b2rpt commented Nov 27, 2024

Describe the bug
The current regular expression used for validating Israeli phone numbers is flawed and needs updating to accurately match the expected formats (issue with number (+972768818873). The existing regex is as follows:
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,

Examples
Existing Regex unable to validate all phone number for example +972768818873

Reproductions
const validator = require('validator');

// Correct usage with locale
console.log(validator.isMobilePhone('+972768818873', 'he-IL')); // Should return true but returns false

Additional context
Validator.js version: 1.12.0
Node.js version: 20.0.0
OS platform: [windows, linux, macOS]

@b2rpt b2rpt added the 🐛 bug label Nov 27, 2024
@b2rpt
Copy link
Author

b2rpt commented Nov 27, 2024

if you want i can work and raise PR for this.

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

Successfully merging a pull request may close this issue.

1 participant