re.S是代表.可以匹配\n以及“  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:\n 234455"\n aaa\n aawaw\n ']

相关文章:

  • 2021-12-12
  • 2022-02-20
  • 2021-10-19
  • 2022-02-15
猜你喜欢
  • 2022-02-05
  • 2021-06-13
  • 2021-11-01
  • 2021-12-04
  • 2021-07-06
相关资源
相似解决方案