I need remove all li which contain
<img src="/mapfiles/
For example I have:
<li class="g"><span>Text</span></li>
<li class="g"><span>Text<img src=\"/mapfiles/iconA.png\"></span></li>**- I need remove it**
<li class="g"><span>Text<img src=\"/mapfiles/iconB.png\"></span></li>**- I need remove it**
<li class="g"><span>Text</span></li>
I tried use this:
preg_replace('!<li class="g">(.*)<img src="/mapfiles/(.*)</li>!is', '', $content);
But Regex match first < li class="g"> and last < /li> so removes all < li>, how can I write regex to find the nearest < /li> ?