# -*- coding: utf-8 -*-
import io, sys, os, re
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
idx=open("index_main.html",encoding="utf-8").read()
catd=idx[idx.find("const CATD="):idx.find("const VERIFIED_DETAILS=")]

# 精确搜索 UT 开头的条目
for kw in ["pharmaceutical","civil","biomedical communications","applied computing","computer science"]:
    hits=re.findall(r'\["ut"[^\]]*'+re.escape(kw.lower())+r'[^\]]*\]', catd, re.I)
    print("==",kw,"| UT CATD hits:",len(hits))
    for h in hits[:3]:
        dets=re.findall(r'"(details/[^"]+\.html)"',h)
        eng=re.findall(r'"([^"]+)"',h)
        print("   det:",dets[-1] if dets else "?","| eng:",eng[2] if len(eng)>2 else "?","| deg:",eng[4] if len(eng)>4 else "?")
