import re
#----------------------------------------------------------------------
def find():
""""""
with open('1.html') as f:
for i in f.readlines():
try:
i = i.decode('utf8')
hh = re.findall(u'(CVE-.{4}\u5e74\u81f3\d{4}\u5e74)', i)
hh2 = re.findall(u'(CVE-.{4}\u81f3\d{4}\u5e74)', i)
bb = hh + hh2
for j in bb:
j1 = re.sub('\u5e74', '', j)
j2 = re.sub('\u81f3', '-', j1)
print j2
except Exception,e:
pass
#find()
#i = 'CVE-2010年至2531年klklkCVE-2O10至2531年'
#i = i.decode('utf-8')
#print re.findall(u'年', i)
#print re.findall(u'至', i)
with open('1.html') as f:
for i in f.readlines():
#print re.findall(u'CVE-\d{4}\xc4\xea\xd6\xc1\d{4}\xc4\xea', i)
i = i.decode('utf8')
hh = re.findall(u'\u5e74\u81f3', i)
print hh
#hh2 = re.findall(u'CVE-.{4}', i)
bb = hh
print bb
for j in bb:
j1 = re.sub('\xc4\xea', '',j)
j2 = re.sub('\xd6\xc1', '-', j1)
print j2
![](https://img.haomeiwen.com/i4170354/7afce54eb184cb91.png)
image.png
网友评论