Use a default regex when possible (#205)
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user