Answers for "check if valid regex string python"

0

check if valid regex string python

import re
string = '['
try:
    re.compile(string)
    is_valid = True
except re.error:
    is_valid = False
Posted by: Guest on September-06-2020

Code answers related to "check if valid regex string python"

Python Answers by Framework

Browse Popular Code Answers by Language