我在网上找了一些,放进去,都提示什么转义字符什么错误的,,郁闷。。

解决方案 »

  1.   

    javascript获取html中的图片地址
      

  2.   


          string str="<img\\s*src=(['\"])([^\\1]*)\\1[^>]*";
      

  3.   

    <div class="imgLAreapic"><a href="http://ent.qq.com/a/20080728/000030.htm"><img alt="张卫健张茜秀恩爱 不习惯被称“先生太太”" src="http://img1.qq.com/ent/pics/11918/11918163.jpg" /></a><br />
    为什么仍然提取不到上面的图片地址呢??
      

  4.   

    System.Text.RegularExpressions.Regex  reg=new  System.Text.RegularExpressions.Regex("<img\\s*src=(['\"])([^\\1]*)\\1[^>]*",System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
    System.Text.RegularExpressions.MatchCollection m = reg.Matches(str); 
    for (int i = 0; i < m.Count; i++) s.Add(m[i].Groups["value"].ToString());m.count总是为0郁闷
      

  5.   

    最上面加
    using System.Text.RegularExpressions;
    [code=C#]
            string str = @"(?<=<img[^>]+src="")[^""]+";
            Regex r = new Regex(str, RegexOptions.IgnoreCase);
            Match m = r.Match("html代码");
            while (m.Success)
            {
                s.Add(m.Value.ToString());
                m = m.NextMatch();
            }[code]
      

  6.   


    还不是行??为撒??、
    郁闷
    提示:正在分析“(? <= <img[^>]+src=")[^"]+)”- 无法识别的分组构造。参数名: (? <= <img[^>]+src=")[^"]+)