• + 0 comments

    ''' (?=(?:.\d.){3,}) => This is a lookahead to check that the string contains at least 3 digits (0-9). (?=(?:.[A-Z].){2,}) => This is a lookahead to check that the string contains at least 2 Uppercase letters (A-Z). (?!.(.).\1) => ensure that no character repeats. '^', '$' [a-zA-Z0-9]{10} => This part matches exactly 10 alphanumeric characters. ''' import re
    for _ in range(int(input())): print("Valid" if re.match(r"^(?=(?:.\d.){3,})(?=(?:.[A-Z].){2,})(?!.(.).\1)[a-zA-Z0-9]{10}$", input()) else "Invalid")