Checks that the input contains UK postcodes.
1 2 3 4 5 6 7
Input to check.
A logical value. If
How severe should the consequences of the assertion be?
TRUE if the input string
contains a valid UK postcode. The assert_* function returns nothing but
throws an error when the
is_* function returns
The function doesn't guarantee that the postcode actually exists. It
should correctly return
TRUE for genuine postcodes, and will weed out
most badly formatted strings and non-existent areas, but some non-existent
districts may incorrectly return
TRUE. If you need 100
check against an up-to-date postcode database.
Regexes taken from https://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Validation.
1 2 3 4 5