UK Postcode Regular Expression 2
Here is a UK postcode matching regular expression. I built it using a database of all the UK postcodes, so it does work for the strange ones.
This regular expression will match the first part:
^[A-Z]{1,2}[0-9]{1,2}[A-Z]?$
It will allow: B1, LN8, EC2M.
It will not allow: 123, 1LL, N123.
This regular expression should match the entire postcode:
^[A-Z]{1,2}[0-9]{1,2}[A-Z]? [0-9]{1,2}[A-Z]{1,3}$
It will allow: B1 7AB, LN8 12AR, EC2M 9CD.
It will not allow: 123 123, 1LL 123, N123 ASD.
Hope you find these as useful as I did.
Am gonna use this expresions
Thanks
NHjufU http://jfkIj4nC01mcKkavYstU3l.net