python正则表达式匹配多行的问题

Posted by Remilia Scarlet on November 25, 2019

问题:re.search(r’<section name=”articleBody”.+?</section>’,text)每次都匹配失败

原因:在python的正则表达式中.不会去匹配\n

解决:re.search(r’<section name=”articleBody”.+?</section>’,text,re.DOTALL)


| 访问量: