/^(([A-Z][A-Z]{0,1})([0-9][A-Z0-9]{0,1})) {0,}(([0-9])([A-Z]{2}))$/i
https://www.regexplanet.com/share/index.html?share=yyyyf8tmb3r