要用preg_match_all提取过滤出网页中这种类型的图片链接的正则表达式该怎么写?链接类型如下
http://5.share.photo.xuite.net/east90/150e088/5414239/208086313_c.jpg写了半天提取不出来,请高手指点一下!!

解决方案 »

  1.   

    <div class="photo_item inline-block">
            <a href="http://photo.xuite.net/east90/5414239/2.jpg"><img src="http://5.share.photo.xuite.net/east90/150e075/5414239/208086038_c.jpg" onerror="javascript:this.src='/images/blank.gif'" border="0" class="photo_cover "></a>
            <div class="photo_info">
                            <p class="photo_info_title"><a href="http://photo.xuite.net/east90/5414239/2.jpg">2.jpg</a></p>
                                    </div>
        </div>
            <div class="photo_item inline-block">
            <a href="http://photo.xuite.net/east90/5414239/3.jpg"><img src="http://5.share.photo.xuite.net/east90/150e07d/5414239/208086046_c.jpg" onerror="javascript:this.src='/images/blank.gif'" border="0" class="photo_cover "></a>
            <div class="photo_info">
                            <p class="photo_info_title"><a href="http://photo.xuite.net/east90/5414239/3.jpg">3.jpg</a></p>
                                    </div>
        </div>
            <div class="photo_item inline-block">
            <a href="http://photo.xuite.net/east90/5414239/4.jpg"><img src="http://5.share.photo.xuite.net/east90/150e085/5414239/208086054_c.jpg" onerror="javascript:this.src='/images/blank.gif'" border="0" class="photo_cover "></a>
            <div class="photo_info">
                            <p class="photo_info_title"><a href="http://photo.xuite.net/east90/5414239/4.jpg">4.jpg</a></p>
                                    </div>
      

  2.   

    过滤出http://5.share.photo.xuite.net/east90/150e088/5414239/208086313_c.jpg这种地址来,
      

  3.   

    就是<img >标签的src地址?
      

  4.   

    是的,是的但是网页还有其他的图片地址
    如http://img.xuite.net/_v_1.0.12/personal/photo/images/logo_photo.png
    http://8.share.photo.xuite.net/event/18c543e/5077425/206219149_o.jpg
    这种的不要
    只要http://5.share.photo.xuite.net/east90/150e088/5414239/208086313_c.jpg
    这种的
    也就是只提取含有 east90 的图片地址
      

  5.   


    preg_match_all('/img src="(http\:\/\/[east90\/\.a-z0-9\_]+\.jpg|png|gif)/isU', $str, $matches);
    print_r($matches[1]);
    看看是不是你要的?正則我也不是很熟練..
      

  6.   


    $s=<<<html
    <img src="http://5.share.photo.xuite.net/east90/150e075/5414239/208086038_c.jpg">
    <img src="http://5.share.photo.xuite.net/aa65/150e075/5414239/aadsfadsfsdff.jpg">
    <img src="http://5.share.photo.xuite.net/east90/150e075/5414239/bb.jpg">
    html;
    preg_match_all('#<img src="([^"]*(?=/east90/)[^"]*)"[^>]*>#isU',$s,$m);
    print_r($m[1]);
    /*
    输出
    Array
    (
        [0] => http://5.share.photo.xuite.net/east90/150e075/5414239/208086038_c.jpg
        [1] => http://5.share.photo.xuite.net/east90/150e075/5414239/bb.jpg
    )
    */