def extract_answer(response): answer = re.search(r"(.*?)", response, re.DOTALL) if answer is not None: return answer.group(1).strip() else: return ""