https://python3-cookbook.read…
re.compile() 函数承受一个标记参数叫 re.DOTALL,在这里十分有用。它能够让正则表达式中的点 (.) 匹配包含换行符在内的任意字符
page = '''
<VirtualHost *:80>
just for test
</VirtualHost>
<VirtualHost *:80>
xixihaha for xixihaha
</VirtualHost>
'''reg = r'<VirtualHost \*:80>(.*?)</VirtualHost>'
content = re.compile(reg,re.DOTALL)
contentlist = content.findall(page)
print contentlist