为别人写得,问得人多,记下笔记:
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;
}
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;
}