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

check string equal with regular expression python

Similar Code Examples