Email Address RegEx

Email Address RegEx For this I just wanted a basic regex for email addresses, it will get nearly all emails but there’s likely to be some edge cases that it’s unhappy with. ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

UK Postcode RegEx

UK Postcode RegEx Recently I needed to validate UK postcodes for a site I was building, after a bit of hunting around this seemed to be the best one that I could find, hopefully this will save me some Googling in future! ^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))\s?[0-9][A-Za-z]{2})$