• + 0 comments

    why is this code not working, can someone explain why?

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    import re 
    
    n = int(input())
    
    regPat = r'^(?=(.*[A-Z]){2,})(?=(.*\d){3,})(?!.*(.).*\1)[a-zA-Z0-9]{10}$'
    
    for _ in range(n):
        if re.match(regPat, input()):
            print("Valid")
        else:
            print("Invalid")