C# 正则获取href里面的值
时间:2014-04-30 22:32:40
收藏:0
阅读:168
string reg = @"<a[^>]*href=([""‘])?(?<href>[^‘""]+)\1[^>]*>";
MatchCollection matches = Regex.Matches(content, reg, RegexOptions.IgnoreCase);
foreach (Match item in matches)
{
var href= item.Groups[1].Value;
}
评论(0)