You are viewing a single comment's thread. Return to all 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
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Incorrect Regex
You are viewing a single comment's thread. Return to all 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