python正则表达式 Posted on 2019-10-11 In Python Views: Views: Valine: regex 多行匹配用单行模式 1longtables = re.findall(r"\\begin{longtable}.*?\\end{longtable}", tex_raw, flags=re.DOTALL) # 单行模式 https://www.lfhacks.com/tech/python-re-single-multiline