fix(isMobilePhone): correct de-LU regex to allow all valid mobile pre…#2715
Open
tommyhgunz14 wants to merge 1 commit into
Open
fix(isMobilePhone): correct de-LU regex to allow all valid mobile pre…#2715tommyhgunz14 wants to merge 1 commit into
tommyhgunz14 wants to merge 1 commit into
Conversation
…fixes
The de-LU (Luxembourg) mobile phone regex incorrectly required the
third digit to be '1' (pattern: 6\d1), rejecting valid numbers like
+352628123456 or +352678123456.
Changed (6\d1) to (6\d{2}) to accept all Luxembourg mobile numbers
starting with 6 followed by any two digits.
Added test cases covering previously rejected valid prefixes (628, 661,
671, 691) and an additional invalid case.
Closes validatorjs#1727
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2715 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2587 2587
Branches 656 656
=========================================
Hits 2587 2587 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the
de-LU(Luxembourg) mobile phone regex which incorrectly required the third digit to be1(pattern:6\d1), rejecting valid Luxembourg mobile numbers like+352628123456or+352678123456.Change
(6\d1)→(6\d{2})to accept all Luxembourg mobile numbers starting with6followed by any two digits.Tests added
Valid:
+352621123456,+352628123456,+352661123456,+352671234567,+352691234567,628123456,691234567Invalid:
+352512345678(non-mobile prefix)All 318 tests pass ✅
References
6xxprefix rangeCloses #1727
Checklist