-
Notifications
You must be signed in to change notification settings - Fork 10
Validation: support address, check postcode regex isnt too clever #71
Comments
Humm this might be tough, |
When this was first implemented (for the Brexit EU Funding Form), we took the regex from https://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Validation. This seems to cover all formats of UK postcode, plus the BFPO addresses, non-geographic special cases and British Overseas Territories. |
|
!? the santa claus postcode is real |
as long as you're confident and have used the logic elsewhere, feel free to close :) |
We could probably simplify the regular expression by removing the British Overseas Territories. If we don't already have it, we should probably have a test to check the following are all valid:
Plus all of the above without a space. |
It looks a bit clever, we need to make sure it doesnt restrict input by making too many assumptions about postcodes.
The text was updated successfully, but these errors were encountered: