一段找出URL的代码(C#)
发表于:2007-06-30来源:作者:点击数:
标签:
string str="wecncnc<a href="list.asp?Page=1&boardid=33&t=656727&p=11&tp=%B9%AB%BF%AAICSI%B5%C4MP3%B7%BD%B0%B8%C9%E8%BC%C6">下一页</a>";
str+="wecncnc<a href="listww.asp?Page=1&boardid=33&t=656727&p=11&tp=%B9%AB%BF%AAICSI%B5%C4MP3%B7%BD%B0%B8%C9%E8%BC%C6">下一页</a>";
Regex re = new Regex(@"<a[^>]+href=""(?<url>[^""]+)""",RegexOptions.IgnoreCase);
Match m = re.Match(str);
if (m.Su
clearcase/" target="_blank" >ccess)
Console.WriteLine(m.Groups["url"].Value);
原文转自:http://www.ltesting.net