Use a default regex when possible (#205)
This commit is contained in:
@@ -3,7 +3,6 @@ import re
|
||||
from common import endoflife
|
||||
|
||||
URL = "https://www.unrealircd.org/docwiki/index.php?title=History_of_UnrealIRCd_releases&action=raw"
|
||||
REGEX = r"^(?:(\d+\.(?:\d+\.)*\d+))$"
|
||||
|
||||
print("::group::unrealircd")
|
||||
response = endoflife.fetch_url(URL)
|
||||
@@ -14,7 +13,7 @@ for tr in wikicode.ifilter_tags(matches=lambda node: node.tag == "tr"):
|
||||
items = tr.contents.filter_tags(matches=lambda node: node.tag == "td")
|
||||
if len(items) >= 2:
|
||||
maybe_version = items[0].__strip__()
|
||||
if re.match(REGEX, maybe_version):
|
||||
if re.match(endoflife.DEFAULT_VERSION_REGEX, maybe_version):
|
||||
maybe_date = items[1].__strip__()
|
||||
if re.match(r"\d{4}-\d{2}-\d{2}", maybe_date):
|
||||
versions[maybe_version] = maybe_date
|
||||
|
||||
Reference in New Issue
Block a user