Use a default regex when possible (#205)

This commit is contained in:
Marc Wrobel
2023-12-01 21:08:11 +01:00
parent e97e261946
commit 750faaa64f
10 changed files with 20 additions and 35 deletions

View File

@@ -3,7 +3,6 @@ from common import dates
from common import endoflife
URL = "https://raw.githubusercontent.com/rocky-linux/wiki.rockylinux.org/development/docs/include/releng/version_table.md"
REGEX = r"^(\d+\.\d+)$"
def parse_date(date_str):
@@ -17,7 +16,7 @@ def parse_markdown_table(table_text):
for line in lines:
items = line.split('|')
if len(items) >=5 and re.match(REGEX, items[1].strip()):
if len(items) >=5 and re.match(endoflife.DEFAULT_VERSION_REGEX, items[1].strip()):
version = items[1].strip()
date = parse_date(items[3])
print(f"{version}: {date}")