python匹配两个短语之间的字符

def ref_txt_demo():
    f = open('1.txt', 'r')
    data = f.readlines()
    for line in data:
        line1 = str(line.strip())
        result = re.findall('中.*?法', line1)
        for x in result:
            print(x)

你可能感兴趣的:(python)