3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = ' <li><a href="/Nike-Pro-3-Shorts-131265.html"> <img src="http://img1.theiconic.com.au/7BXi4UQfOYe0JssK5eoA2htIG_8=/fit-in/274x346/filters:fill(ffffff):quality(90):format(webp)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Fnike-5832-562131-2.jpg" width="100%"></a></li> <li><a href="http://www.theiconic.com.au/Tech-Capri-130367.html"> <img src="http://img1.theiconic.com.au/SrNeE3dYXF1hF7NBDVNaeZhuTLA=/trim/fit-in/490x627/filters:quality(95):fill(ffffff)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Fnike-9908-763031-1.jpg" width="100%"></a></li> <li><a href="http://www.theiconic.com.au/Gelato-448-Push-Up-Crop-Top-in-Neon-Pink-158395.html"> <img src="http://img1.theiconic.com.au/_Sh69_gKCFiagKDTtWEBaESt4WY=/trim/fit-in/490x627/filters:quality(95):fill(ffffff)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Frunning-bare-0938-593851-1.jpg" width="100%"></a></li> <li><a href="http://www.theiconic.com.au/Energy-Boost-2-in-Neon-Pink-162755.html"> <img src="http://img1.theiconic.com.au/Kmd2GD5ZA_nNeyrLxyif2TYhGQM=/trim/fit-in/490x627/filters:quality(95):fill(ffffff)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Fadidas-performance-9782-557261-1.jpg" width="100%"></a></li> <ul class="small-block-grid-1 medium-block-grid-3 large-block-grid-4 spCarousel"> <li><a href="/Nike-Pro-3-Shorts-131265.html"> <img src="http://img1.theiconic.com.au/7BXi4UQfOYe0JssK5eoA2htIG_8=/fit-in/274x346/filters:fill(ffffff):quality(90):format(webp)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Fnike-5832-562131-2.jpg" width="100%"></a></li> <li><a href="http://www.theiconic.com.au/Tech-Capri-130367.html"> <img src="http://img1.theiconic.com.au/SrNeE3dYXF1hF7NBDVNaeZhuTLA=/trim/fit-in/490x627/filters:quality(95):fill(ffffff)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Fnike-9908-763031-1.jpg" width="100%"></a></li> <li><a href="http://www.theiconic.com.au/Gelato-448-Push-Up-Crop-Top-in-Neon-Pink-158395.html"> <img src="http://img1.theiconic.com.au/_Sh69_gKCFiagKDTtWEBaESt4WY=/trim/fit-in/490x627/filters:quality(95):fill(ffffff)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Frunning-bare-0938-593851-1.jpg" width="100%"></a></li> <li><a href="http://www.theiconic.com.au/Energy-Boost-2-in-Neon-Pink-162755.html"> <img src="http://img1.theiconic.com.au/Kmd2GD5ZA_nNeyrLxyif2TYhGQM=/trim/fit-in/490x627/filters:quality(95):fill(ffffff)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Fadidas-performance-9782-557261-1.jpg" width="100%"></a></li> <div class="brand small-4 columns"> [http://static.theiconic.com.au/cms/site_updates/Week 42/MSS_1_150x245px.jpg, (default)], [//static.theiconic.com.au/cms/site_updates/Week 42/MSS_1_150x245px.jpg, (medium)], [//static.theiconic.com.au/cms/site_updates/Week 42/MSS_1_150x245px.jpg, (large)], [//static.theiconic.com.au/cms/site_updates/Week 42/MSS_1_150x245px.jpg, (xlarge)]" //www.theiconic.com.au <img data-interchange="[//img1.theiconic.com.au/m4vHwoKT2A1yyg1jDWVpBWpp8uc=/trim/fit-in/490x627/filters:quality(95):fill(ffffff)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Fspurr-basics-3847-893151-1.jpg, (default)]"> <img data-interchange="[//img1.theiconic.com.au/cSIL4OOfsfSWcOLqsdHfXie83UU=/trim/fit-in/490x627/filters:quality(95):fill(ffffff)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Fkeepsake-the-label-1642-056751-1.jpg, (default)]"> <img data-interchange="[//img1.theiconic.com.au/D8k6ZV8RDzBoXTCRBc2m5wpX2_8=/trim/fit-in/490x627/filters:quality(95):fill(ffffff)/http%3A%2F%2Fstatic.theiconic.com.au%2Fp%2Fbardot-4474-602071-1.jpg, (default)]"> '; preg_match_all('#\bhttp://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $string, $match); echo "<pre>"; print_r($match); echo "</pre>";
based on Aki0b
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
<pre>Array ( [0] => Array ( [0] => http://img1.theiconic.com.au/7BXi4UQfOYe0JssK5eoA2htIG_8=/fit-in/274x346/filters:fill(ffffff) [1] => http://www.theiconic.com.au/Tech-Capri-130367.html [2] => http://img1.theiconic.com.au/SrNeE3dYXF1hF7NBDVNaeZhuTLA=/trim/fit-in/490x627/filters:quality(95) [3] => http://www.theiconic.com.au/Gelato-448-Push-Up-Crop-Top-in-Neon-Pink-158395.html [4] => http://img1.theiconic.com.au/_Sh69_gKCFiagKDTtWEBaESt4WY=/trim/fit-in/490x627/filters:quality(95) [5] => http://www.theiconic.com.au/Energy-Boost-2-in-Neon-Pink-162755.html [6] => http://img1.theiconic.com.au/Kmd2GD5ZA_nNeyrLxyif2TYhGQM=/trim/fit-in/490x627/filters:quality(95) [7] => http://img1.theiconic.com.au/7BXi4UQfOYe0JssK5eoA2htIG_8=/fit-in/274x346/filters:fill(ffffff) [8] => http://www.theiconic.com.au/Tech-Capri-130367.html [9] => http://img1.theiconic.com.au/SrNeE3dYXF1hF7NBDVNaeZhuTLA=/trim/fit-in/490x627/filters:quality(95) [10] => http://www.theiconic.com.au/Gelato-448-Push-Up-Crop-Top-in-Neon-Pink-158395.html [11] => http://img1.theiconic.com.au/_Sh69_gKCFiagKDTtWEBaESt4WY=/trim/fit-in/490x627/filters:quality(95) [12] => http://www.theiconic.com.au/Energy-Boost-2-in-Neon-Pink-162755.html [13] => http://img1.theiconic.com.au/Kmd2GD5ZA_nNeyrLxyif2TYhGQM=/trim/fit-in/490x627/filters:quality(95) [14] => http://static.theiconic.com.au/cms/site_updates/Week ) [1] => Array ( [0] => [1] => l [2] => [3] => l [4] => [5] => l [6] => [7] => [8] => l [9] => [10] => l [11] => [12] => l [13] => [14] => k ) ) </pre>