Regex validation code for UK postcodes
There are a number of different formats for UK postcodes and validating them can be a hassle. I have now saved you that hassle by providing the postcode Regex validation below. This Regex code will validate UK Postcodes. Feel free to use as you wish ^[A-Za-z]{1,2}[0-9]{1,2} ?[0-9][A-Za-z]{2}$/






