I'm trying to write a regex function that will return the sector of a postcode.
The user could type the following postcodes:
- WA14 5
- WA12 5GJ
I need the regex just to return the sector of the postcode.
I've tried the following but it doesn't work:
^[a-zA-Z]+\d\d?[a-zA-Z]?\s*\d+
^(((([A-Z][A-Z]{0,1})[0-9][A-Z0-9]{0,1}) {0,}[0-9]))$
Thanks