python 中re模块匹配换行中的字符
使用 re.compile(patt).findall(string)可以使用2中方法
①.patt中正则表达式为:'([\s\S]*?)' ,使用[\s\S]
②.re.compile(patt,re.S).findall(string) ,在匹配中加入re.S
直接使用re.findall,则仍然可以使用上面2种方法
re.findall(patt,string,re.S)
使用 re.compile(patt).findall(string)可以使用2中方法
①.patt中正则表达式为:'([\s\S]*?)' ,使用[\s\S]
②.re.compile(patt,re.S).findall(string) ,在匹配中加入re.S
直接使用re.findall,则仍然可以使用上面2种方法
re.findall(patt,string,re.S)