try
using System.Text.RegularExpressions;
string s= @"<TD class=msc><A class=t href=""http://www.xbom.com/iibs/ZH/buildcoupon.asp?couponchoice=F501154"">xxyoup 搜索大全</A></TD>"; Regex re = new Regex(@"<a[^>]+href=(?:""(?<url>[^""]+)""|'(?<url>[^']+)')", RegexOptions.IgnoreCase);
Match m = re.Match(s);
if (m.Success)
{
Console.WriteLine("{0} is {1}", s, m.Groups["url"].Value);
}
using System.Text.RegularExpressions;
string s= @"<TD class=msc><A class=t href=""http://www.xbom.com/iibs/ZH/buildcoupon.asp?couponchoice=F501154"">xxyoup 搜索大全</A></TD>"; Regex re = new Regex(@"<a[^>]+href=(?:""(?<url>[^""]+)""|'(?<url>[^']+)')", RegexOptions.IgnoreCase);
Match m = re.Match(s);
if (m.Success)
{
Console.WriteLine("{0} is {1}", s, m.Groups["url"].Value);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货