def METHOD_NAME(self):
    pat = self.getpat()
    if not pat:
        self.report_error(pat, "Empty regular expression")
        return None
    pat = self.getcookedpat()
    flags = 0
    if not self.iscase():
        flags = flags | re.IGNORECASE
    try:
        prog = re.compile(pat, flags)
    except re.error, what:
        try:
            msg, col = what
        except:
            msg = str(what)
            col = -1
        self.report_error(pat, msg, col)
        return None
    return prog