1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +02:00

update regex to match version

This commit is contained in:
kev 2015-07-15 12:04:05 +08:00
parent 8443ef57f3
commit 06d53a4bcc

View File

@ -28,7 +28,7 @@ def filter(url, data):
try:
dom = lxml.html.fromstring(data.encode('utf-8'))
txt = dom.xpath(exp)[0]
ver = re.search(r'([0-9]+\.)*[0-9]+', txt).group(0)
ver = re.search(r'(?i)([0-9]+\.)*[0-9]+(-?(alpha|beta|rc)[0-9]+)?', txt).group(0).lower()
return '{}: {}\n'.format(key, ver)
except:
return '{}: {}\n'.format(key, 'unknown')