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 typo in regex for GB postcodes #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmorgadosoares
Copy link

Corrected a missing dash in the regular expression used for postcode validation. The old regex failed to properly validate certain postcodes from the list of valid examples, despite the validate function working correctly.

Specifically, the postcodes "W1A 0AX" and "W1U 1BW" (without the redundant spaces) were not validated by the regex due to the missing dash.

image

It's probably due to an issue with the ValidationRegex.DOC on page 6 here https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/488478/Bulk_Data_Transfer_-_additional_validation_valid_from_12_November_2015.pdf

When you copy the regex it fails to copy the dash as well

image

Corrected a missing dash in the regular expression used for postcode validation. The old regex failed to properly validate certain postcodes from the list of valid examples, despite the validate function working correctly. Specifically, the postcodes "W1A 0AX" and "W1U 1BW" (without the redundant spaces) were not validated by the regex due to the missing dash.
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