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

Fix postal code validation for france locality #2484

Conversation

mash3al-29
Copy link

This PR adds a regular expression (regex) to validate French postal codes accurately. The regex is designed to ensure that postal codes match the valid formats as specified by the French postal system. This change was made to accommodate additional test cases for postal code validation.

The new regex pattern is:
/^(?:(?:0[1-9]|[1-8]\d|9[0-5])\d{3}|97[1-46]\d{2})$/

This pattern allows for postal codes in the ranges of 01000 to 95999 and the overseas departments.

For more information on French postal codes and their structure, refer to the official postal service documentation La Poste.

Checklist

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

@mash3al-29 mash3al-29 closed this Oct 24, 2024
@mash3al-29 mash3al-29 deleted the bugfix/fix-postal-code-validation branch October 24, 2024 17:02
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.

1 participant