I've had an error come up with my regex in Ruby - The postcode BT9 6NZ
managed to slip through written as BT96NZ
- is there any way to edit this to make it foolproof to that?
The code as I have it is below:
^BT\d{1,2}\s|^HS\d{1,2}\s|KA27|AB31|AB32|AB33|AB34|AB35|AB36|AB37|AB38|PH4|PH5|PH6|PH7|PH8|PH9|KA28|^KW\d{1,2}\s|^IM\d{1,2}\s|^IV\d{1,2}\s|^AB4\d{1}\s|^AB5\d{1}\s|^PA2\d{1}\s|^PA3\d{1}\s|^PA4\d{1}\s|^PA5\d{1}\s|^PA6\d{1}\s|^PA7\d{1}\s|^PH1\d{1}\s|^PH2\d{1}\s|^PH3\d{1}\s|^PH4\d{1}\s|^PH5\d{1}\s