using System.Text.RegularExpressions;
List<string> list=new List<string>();
Regex reg=new Regex(@"<img\b[^<>]*?\bsrc[\s\t\r\n]*=[\s\t\r\n]*[""']?[\s\t\r\n]*(?<imgUrl>[^\s\t\r\n""'<>]*)[^<>]*?/?[\s\t\r\n]*>", RegexOptions.IgnoreCase);
MatchCollection mc = reg.Matches(model.Memo);
foreach (Match m in mc)
{
list.Add(m.Groups["imgUrl"].Value);
}
从html文本中获取所有img标签
最新推荐文章于 2022-11-22 12:08:40 发布