• + 0 comments

    python2

    import re T = int(input()) for _ in range(T): try: re.compile(raw_input()) print('True') except re.error: print('False')