We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Incorrect Regex
Incorrect Regex
Sort by
recency
|
312 Discussions
|
Please Login in order to post a comment
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
import re num=int(input())` for _ in range(num): string=input() try: re.compile(string) print(True) except re.error: print(False)