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

Bugfixing/fix postal france code validation #2486

Conversation

mash3al-29
Copy link

This PR introduces a new regular expression (regex) to improve the validation of French postal codes (locale: FR). The regex ensures that postal codes conform to valid formats as defined by the French postal system.

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

This pattern validates postal codes in the ranges of 01000 to 95999 and includes specific handling for overseas french departments.

This fix directly addresses the previously identified bug and ensures that the postal code validation works reliably.

For reference on the structure of French postal codes, please see La Poste, which outlines the valid formats and regulations for postal codes in France.

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 by deleting the head repository Oct 26, 2024
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