def METHOD_NAME(self, regex):
    if regex is None or len(regex) == 0:
        self.regex_c = None
        self.regex = None
        return
    try:
        self.regex_c = re.compile(regex)
        self.regex = regex
    except Exception as e:
        self.regex = None
        msgerr = "Couldn't compile regular expression: {}".format(e)
        self.fv.show_error(msgerr)