You are viewing a single comment's thread. Return to all comments →
To avoid the EOF error we need to use try & except
import re no = int(input()) for _ in range(no): try: regex = input() if '*+' in regex or '++' in regex or '+?' in regex: print("False") else: re.compile(regex) print("True") except re.error: print("False")
Seems like cookies are disabled on this browser, please enable them to open this website
Incorrect Regex
You are viewing a single comment's thread. Return to all comments →
To avoid the EOF error we need to use try & except