import re
a = 'A000AA'
pattern = r'[ABCEHKMOPTXY]\d{3}[ABCEHKMOPTXY]{2}'
print( bool(re.fullmatch( pattern, a)) )
