<?php $re = '/url(\(((?:[^()]+|(?1))+)\))/m'; $str = 'url(https://exemples.com/fonts/lato/lato/lato-regular-webfont.ttf) src:url(https://exemples.com/fonts/lato/lato-regular-webfont.eot?#iefix) background:url(https://exemples.com/product/header/img.png) background:url(/product/header/img.png) background:url("/product/header/img.png") background:url(\'/product/header/img.png\') background:url(/uploads/2019/03/0002-image(thumbnail_product).jpg) .card-thumb__img1{display:block;width:142px;height:62px;background:url(https://example.com/product01.jpg) center center no-repeat;background-size:contain}@media (max-width:1029px).card-thumb__img2{display:block;z-index:1;background:url(https://example.com/product02.jpg) center center no-repeat #000; background-image: url(/uploads/2019/03/product01-image(thumbnail_photo).jpg); '; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); foreach ($matches as $match) { if (preg_match('/^([\'"]?)[^"]+\1$/', $match[2])) { echo trim($match[2], "'\"") . PHP_EOL; } }
You have javascript disabled. You will not be able to edit any code.