• + 0 comments

    import re for _ in range(int(input())): try: print(bool(re.compile(input()))) except re.error: print("False")

    Fewer lines of code, but this is wrong in the long run, it's just a joke