Jump to content

need help in regex


subhomoy

Recommended Posts

hello every body,

 

Currently i'm scraping web data for a demo project but i cant preg_match the value from this html.

The html code is 
 

<div class="carouselContainer leftDisabled">
                    <ul class="carousel leftDisabled">
                            <li>
                                <div class="thumbContainer">
                                    <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzb4ywyj25mw4.jpeg)"
                                         data-imageId="IMADZB4YWYJ25MW4">
                                    </div>
                                </div>
                            </li>
                            <li>
                                <div class="thumbContainer">
                                    <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzb4zhk4855ny.jpeg)"
                                         data-imageId="IMADZB4ZHK4855NY">
                                    </div>
                                </div>
                            </li>
                            <li>
                                <div class="thumbContainer">
                                    <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzwrpmdwhnxg7.jpeg)"
                                         data-imageId="IMADZWRPMDWHNXG7">
                                    </div>
                                </div>
                            </li>
                            <li>
                                <div class="thumbContainer">
                                    <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzwvvz3deeh4c.jpeg)"
                                         data-imageId="IMADZWVVZ3DEEH4C">
                                    </div>
                                </div>
                            </li>
                    </ul>
            </div>

The regex i've used is

preg_match_all('|<div class="carouselContainer leftDisabled"+>(.*)</div+>|U',$txt,$matches3);

I want only the images images url from that specific block.

 

Can anybody help me in this plz...

Link to comment
https://forums.phpfreaks.com/topic/296450-need-help-in-regex/
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.