如何提取下面的href后面的连接 有多个.
<a href="http://fineboy.cnblogs.com/archive/2005/09/09/233088.html" target=_blank class=l onmousedown="return clk(0,'','','res','3','','0CA4QFjAC')">全面剖析C#<em>正则表达式</em>- 梦幻Dot Net - 博客园</a><a href="bbs.dvbbs.net" target=_blank class=l onmousedown="return clk(0,'','','res','3','','0CA4QFjAC')">dvbbs</a>麻烦高手指点一下
顺便说明原理.非常感激..
<a href="http://fineboy.cnblogs.com/archive/2005/09/09/233088.html" target=_blank class=l onmousedown="return clk(0,'','','res','3','','0CA4QFjAC')">全面剖析C#<em>正则表达式</em>- 梦幻Dot Net - 博客园</a><a href="bbs.dvbbs.net" target=_blank class=l onmousedown="return clk(0,'','','res','3','','0CA4QFjAC')">dvbbs</a>麻烦高手指点一下
顺便说明原理.非常感激..
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string str = @"<a href=""http://fineboy.cnblogs.com/archive/2005/09/09/233088.html"" target=_blank class=l onmousedown=""return clk(0,'','','res','3','','0CA4QFjAC')"">全面剖析C# <em>正则表达式 </em>- 梦幻Dot Net - 博客园 </a>
<a href=""bbs.dvbbs.net"" target=_blank class=l onmousedown=""return clk(0,'','','res','3','','0CA4QFjAC')"">dvbbs </a>";
MatchCollection mc = Regex.Matches(str, @"(?i)href=""(?<url>[^""]*)""");
for (int i = 0; i < mc.Count; i++)
{
Console.WriteLine(mc[i].Captures[0].Value);
}
}
}
}