第一种方式:
eight_date = re.compile(r"正则式")
str1 = re.search(eight_date, "文本内容").group(0)
第二种方式:
str1 = re.search(r"正则式","文本内容").group(0)