MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / _parse_entries_regex

Method _parse_entries_regex

scripts/fetch_updates.py:1688–1705  ·  view source on GitHub ↗

Fallback regex parser.

(self, html: str)

Source from the content-addressed store, hash-verified

1686 return results
1687
1688 def _parse_entries_regex(self, html: str) -> list[dict]:
1689 """Fallback regex parser."""
1690 results = []
1691 link_re = re.compile(
1692 r'<a[^>]*href="(/medical-devices/[^"]+)"[^>]*>(.*?)</a>',
1693 re.DOTALL,
1694 )
1695 for m in link_re.finditer(html):
1696 href = "https://www.fda.gov" + m.group(1)
1697 title = re.sub(r"<[^>]+>", "", m.group(2)).strip()
1698 if title and len(title) > 10 and self._PRIORITY_KEYWORDS.search(title):
1699 results.append({
1700 "title": title,
1701 "date": "",
1702 "link": href,
1703 "type": "CDRH News",
1704 })
1705 return results
1706
1707
1708# ---------------------------------------------------------------------------

Callers 1

_parse_entriesMethod · 0.95

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected