Skip to content

fix(isMobilePhone): correct de-LU regex to allow all valid mobile pre…#2715

Open
tommyhgunz14 wants to merge 1 commit into
validatorjs:masterfrom
tommyhgunz14:fix/de-lu-mobile-phone-regex
Open

fix(isMobilePhone): correct de-LU regex to allow all valid mobile pre…#2715
tommyhgunz14 wants to merge 1 commit into
validatorjs:masterfrom
tommyhgunz14:fix/de-lu-mobile-phone-regex

Conversation

@tommyhgunz14
Copy link
Copy Markdown

Fixes the de-LU (Luxembourg) mobile phone regex which incorrectly required the third digit to be 1 (pattern: 6\d1), rejecting valid Luxembourg mobile numbers like +352628123456 or +352678123456.

Change

  • (6\d1)(6\d{2}) to accept all Luxembourg mobile numbers starting with 6 followed by any two digits.

Tests added

Valid:
+352621123456, +352628123456, +352661123456, +352671234567, +352691234567, 628123456, 691234567

Invalid:
+352512345678 (non-mobile prefix)

All 318 tests pass ✅

References

Closes #1727

Checklist

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

…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
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7fdc788) to head (ec687fb).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

de-LU regex for mobile phone validator is wrong

1 participant