public static string FetchImgsFromSource(string htmlSource)
{
string OutSource = "";
string regexImgSrc = @"<img[^>]*?src\s*=\s*[""']?([^'"" >]+?)[ '""][^>]*?>";
MatchCollection matchesImgSrc = Regex.Matches(htmlSource, regexImgSrc, RegexOptions.IgnoreCase | RegexOptions.Singleline);
foreach (Match m in matchesImgSrc)
string href = m.Groups[1].Value;
string imgvalue="";
if (href.IndexOf("GUID=") != -1)
int length_ = href.IndexOf("=");
imgvalue= href.Substring(length_+1);
htmlSource=htmlSource.Replace(href,"GetImg("+ imgvalue + ")");
}
return OutSource= htmlSource;