修正:后的匹配

This commit is contained in:
CodingCat 2024-02-19 16:16:41 +08:00
parent c6c02f1631
commit 10dc195f1a

View File

@ -48,8 +48,10 @@ def get_projects(filenames):
lines = category.split('\n')
category_name = lines[0].strip()
projects = result.get(category_name,[])
if category_name == 'python':
print(projects)
for line in lines[1:]:
match = re.search(r'\* \[(.+)\]\((.+)\):(.+)', line)
match = re.search(r'\* \[(.+)\]\((.+)\):(.*)', line)
if match:
project_name, url, description = match.groups()
projects.append(project_name)