The following postcodes are not considered part of UK mainland:

BT
EX39
GY
HS
IM
IV
JE
KA27-28
KW
PA20-49
PA60-78
PH17-PH26
PH30
PH31-PH41
PH42-PH44
PH49-50
PO11
PO30-PO41
TR21-25
ZE