为别人写得,问得人多,记下笔记: string strHtml = ""; Regex rgx = new Regex(@"<img.*?src=(?:""|')?(.*?\.(?:jpg|gif)).*?>", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); MatchCollection mc = rgx.Matchs(strHtml); foreach (Match m in mc) { string strImgUrl = m.Groups[1].Value; } 转载于:https://www.cnblogs.com/evlon/archive/2006/09/01/492314.html