import retext = '''姓名:张三 2013/6/9'''htm = re.findall(r".*?", text)for t in htm: k = re.sub("", "", t) k = re.sub("", "", k) print(k.replace("姓名:", ""))