import re
pattern = re.compile("^([A-Z][0-9]+)+$")
pattern.match(string)