def METHOD_NAME(self):
    "Return compiled cooked search pattern."
    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 as e:
        self.report_error(pat, e.msg, e.pos)
        return None
    return prog