string str ="2008年8月18日中国再拿四枚 <a href=\"www.xxx.com\" title=\"奥运金牌\">金牌 </a>,使中国的金牌总数达到39枚"; Regex r = new Regex("<a.*>(?<title>.*)</a>", RegexOptions.IgnoreCase); MatchCollection mc = r.Matches(str); foreach (Match m in mc) { MessageBox.Show(m.Groups["title"].Value); }
Regex r = new Regex("<a.*>(?<title>.*)</a>", RegexOptions.IgnoreCase);
MatchCollection mc = r.Matches(str);
foreach (Match m in mc)
{
MessageBox.Show(m.Groups["title"].Value);
}
嗯,这次就成了,完全符合要求。问了一天了,终于整到个答案,谢了哈
早上问了一贴都没被人发现到,http://topic.csdn.net/u/20080819/10/73412df2-4f3b-4b78-9648-6efc9e1e3597.html