We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd5c487 commit 5a79f89Copy full SHA for 5a79f89
src/eval/metrics.py
@@ -125,7 +125,7 @@ def count_words(text: str) -> int:
125
126
def count_citations(text: str) -> int:
127
"""Count markdown-style citations [text](url)."""
128
- pattern = r"\[.+?\]\(https?://[^\s\)]+\)"
+ pattern = r"\[[^\]]*\]\(https?://[^\s\)]+\)"
129
return len(re.findall(pattern, text))
130
131
@@ -148,7 +148,7 @@ def extract_domains(text: str) -> List[str]:
148
149
def count_images(text: str) -> int:
150
"""Count markdown images ."""
151
- pattern = r"!\[.*?\]\(.+?\)"
+ pattern = r"!\[[^\]]*\]\([^)]+\)"
152
153
154
0 commit comments