protected string[] GetSrc(string str)
    {
        string regStr = "\\<IMG\\ [\\s\\S]*?src=['\"]?(?<p>[^'\"\\>\\ ]+)['\"\\>\\ ]";
        string cont1 = string.Empty; //图片的src
        Regex reg = new Regex(regStr, RegexOptions.Compiled | RegexOptions.IgnoreCase);
        Match match = reg.Match(str);
        string picSrc = "";
        while (match.Success)
        {
            picSrc = match.Groups["p"].Value;
            cont1 += string.Format("{0}", picSrc + ",");
            match = match.NextMatch();
        }
        cont1 = cont1.Substring(0, cont1.LastIndexOf(','));
        string[] strList = cont1.Split(',');
        return strList;
    }

相关文章: