fix(isPostalCode): Update French postal code regex by Rajput-Balram · Pull Request #2479 · validatorjs/validator.js
Navigation Menu
{{ message }}
validatorjs / validator.js Public
- Notifications You must be signed in to change notification settings
- Fork 2.4k
Merged
WikiRik merged 2 commits intovalidatorjs:masterfrom
Mar 26, 2025Merged
fix(isPostalCode): Update French postal code regex#2479
WikiRik merged 2 commits intovalidatorjs:masterfrom
fix(isPostalCode): Update French postal code regex#2479
WikiRik merged 2 commits intovalidatorjs:masterfrom
Conversation
Copy link Copy Markdown
Contributor
Rajput-Balram
commented
Oct 21, 2024
Rajput-Balram
commented
This PR updates the regex pattern used for validating French postal codes in the isPostalCode function.
- Replaces outdated regex (/^\d{2}\s?\d{3}$/) with accurate pattern (/^(?:(?:0[1-9]|[1-8]\d|9[0-5])\d{3}|97[1-46]\d{2})$/)
- Updates the test fixtures in validators.test.js to ensure accurate testing of French postal code validation.
Fixes #2478
Checklist
- PR contains only changes related; no stray files, etc.
- README updated (where applicable)
- Tests written (where applicable)
- References provided in PR (where applicable)
Copy link Copy Markdown
Contributor Author
Rajput-Balram
commented
Oct 21, 2024
Rajput-Balram commented
Oct 21, 2024Requesting Review @WikiRik
rubiin approved these changes Oct 22, 2024
rubiin
requested a review
from WikiRik
WikiRik approved these changes Mar 26, 2025
WikiRik
merged commit
c174a1f
into
validatorjs:master
WikiRik
mentioned this pull request
fossabot
bot
mentioned this pull request
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