Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here is the official UK postcode regex:

  ^([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])))) [0-9][A-Za-z]{2})$
The second part is always 3 characters. The first part can be 2, 3 or 4 (B1, B30, SW2, SW11, EC1A).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: