Valid PAN format

  • + 0 comments
    import re
    
    regex = re.compile(r'^[A-Z]{5}[0-9]{4}[A-Z]$')
    
    
    for i in range(int(input())):
        if regex.match(input()):
            print('YES')
        else:
            print('NO')