c# 利用正则表达式 提取html中数据

比如在<tr><td colspan="3" style="background-color:#F7FAFF; height: 36px; line-height:20px; "><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="75%"><strong style="font-size: 14px">北京分享天下科技有限公司</strong>

中,通过
<strong style="font-size:14px">{[^<]+}<
提取公司名称,在c#中该如何操作啊?我把正则表达式放入一个字符串中,用转移字符处理了两个双引号的问题,但是不能找到数据了啊!急!!!!

Macth m = Regex.Match(html, "<strong style=\"font-size: 14px\">(?<CompanyName>.*?)</strong>", ...);
if (m.Success)
{
    string companyName = m.Group["CompanyName"].Value;
}


温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-11-06
            Match match = Regex.Match(str, "<strong\\s+style\\s*=\\s*\"font-size\\s*:\\s*14px\\s*\"\\s*>([^<]+)<");
            while (match.Success)
            {
                string value = match.Groups[1].Value;
                //do sth
                match = match.NextMatch();  //查找下一个匹配的公司名
            }

本回答被网友采纳