def check_regex(regexstring):
""" method to check that the regex works"""
if regexstring is not None:
try:
compiledregex = re.compile(regexstring, flags=re.IGNORECASE)
# result = compiledregex.match(string)
except:
raise click.BadOptionUsage("The regex didn't compile. For correct usage"
" see: https://docs.python.org/2/library/re.html")
评论列表
文章目录