Regex reg = new Regex("[ \\s]*href=(\"|')(.*?)(\"|')"); MatchCollection m = reg.Matches(html); foreach (Match mc in m)在遍历的时候对比一下就可以了