日期:2014-05-18 浏览次数:20909 次
Regex re = new Regex("(?s)<a.*?(?:href=\")(?<url>[^\"]*)(.*?(<font[^>]*>)){2}(?<name1>.*?(?=</font>))</font>(?<name2>.*?(?=</font))"); string strContent = "<a onmousedown=\"return c({'fm':'as','F':'779717EA','F1':'9D73F1E4','F2':'4CA6DF6A','F3':'54E5243F','T':'1258959999','title':this.innerHTML,'url':this.href,'p1':8,'y':'9BBE5E3E'})\" "+ "href=\"http://www.baodu.zw78.com/\" target=\"_blank\" > "+ "<font size=\"3\"> <font color=\"#c60a00\">八度 </font>365导航 </font> "; string strUrl = ""; string strName = ""; foreach (Match m in re.Matches(strContent)) { strUrl = m.Groups["url"].Value.Trim(); strName = m.Groups["name1"].Value.Trim() + m.Groups["name2"].Value.Trim(); ; }