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.
is not working. Also tried the following
import re
pattern = r".*+"
try:
re.compile(pattern)
except re.error:
print("Non valid regex pattern")
exit()
Please suggest what is the correct solution, else is there some thing with the validator in hackerrank ?
Incorrect Regex
You are viewing a single comment's thread. Return to all comments →
is not working. Also tried the following import re
pattern = r".*+"
try: re.compile(pattern)
except re.error: print("Non valid regex pattern") exit() Please suggest what is the correct solution, else is there some thing with the validator in hackerrank ?
Please except re.error: print("Non valid regex pattern") exit()