#!/usr/bin/python3.4
# -*- coding: utf-8 -*-
import re
# 抓取html里面string的正则表达式
def getstring(string):
reg = r'(line">\n)(.+?)(<)'
all = re.compile(reg)
alllist = re.findall(all, string)
return alllist[0][1]
if __name__ == '__main__':
string = '''
'''
print(getstring(string))
打印结果:
我也来回答