I have the following code which works to a point, it attempts to exclude UK highlands and Islands from UK postcodes however 2 lines throw the error commented bellow why is this?
$strPostCode = 'AB393HX';
if(!preg_match('/^(ZE|IV|TR|GY|JE)[0-9]/',$strPostCode)
&& !preg_match('/^(AB)[31-38]{2}/',$strPostCode)
&& !preg_match('/^(AB)[41-45]{2}/',$strPostCode)
&& !preg_match('/^(AB)[55-56]{2}/',$strPostCode)
&& !preg_match('/^(PA)[20-78]{2}/',$strPostCode)
&& !preg_match('/^(PH)[15-99]{2}/',$strPostCode)
&& !preg_match('/^(FK)[17-21]{2}/',$strPostCode) // Compilation failed: range out of order in character class at offset 9
&& !preg_match('/^(KA)[27-28]{2}/',$strPostCode) // Compilation failed: range out of order in character class at offset 9
&& !preg_match('/^(HS)[1-9]{1}/',$strPostCode)
&& !preg_match('/^(KW)[0-9]{1}/',$strPostCode)
&& !preg_match('/^(KW)[10-17]{2}/',$strPostCode)
){
echo $strPostCode . ' is good';
}
else{
echo $strPostCode . ' is bad';
}