# -*- coding: utf-8 -*-
import re, io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
idx = open(r"D:\work buddy\2026-11-05-14-15-52\index_main.html", encoding="utf-8").read()
seg = idx[idx.find("const PROGRAMS="):idx.find("const CATD=")]
keywords = ["Regulatory Science", "Medical Physics", "Nonprofit", "Criminology", "Translational Research"]
for kw in keywords:
    hits = re.findall(r'\{id:"[^"]*"[^}]*en:"[^"]*' + re.escape(kw) + r'[^"]*"[^}]*\}', seg, re.IGNORECASE)
    print(f"=== {kw}: {len(hits)} hits ===")
    for h in hits[:3]:
        m = re.search(r'id:"([^"]+)"', h)
        e = re.search(r'en:"([^"]+)"', h)
        u = re.search(r'url:"([^"]+)"', h)
        print("  ", m.group(1) if m else "?", "|", e.group(1) if e else "?", "|", u.group(1) if u else "?")
