re.S是代表.可以匹配
以及“ re.M是多行
code
import re a = '''asdfsafhellopass: 234455 worldafdsf ''' b = re.findall('hello(.*?)world',a) c = re.findall('hello(.*?)world',a,re.S | re.M) print 'b is ' , b print 'c is ' , c
打印结果
b is []
c is ['pass:
234455"
aaa
aawaw
']