epg: fix regex leak in query