3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = ' <div class="brand small-4 columns"> [http://static.theiconic.com.au/cms/site_updates/Week 42/MSS_1_150x245px.jpg, (default)], [http://static.theiconic.com.au/cms/site_updates/Week 42/MSS_1_150x245px.jpg, (medium)], [http://static.theiconic.com.au/cms/site_updates/Week 42/MSS_1_150x245px.jpg, (large)], [http://static.theiconic.com.au/cms/site_updates/Week 42/MSS_1_150x245px.jpg, (xlarge)]" http://www.theiconic.com.au <a href="/Pearl-151398.html" class="ga-track-link-click" data-ga-category="Women Gender Page" data-ga-action="Editors 9 Picks" data-ga-label="SpurrBasics" onClick="_gaq.push" rel="teaser.index.Essentials.75x60.Editors9Picks.SpurrBasics"> <img data-interchange="[http://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)]"> <span class="essential-item"> Spurr Basics<br/> $29.95 </span> </a> </div> <div class="brand small-4 columns"> <a href="/Stolen-Hearts-Dress-157650.html" class="ga-track-link-click" data-ga-category="Women Gender Page" data-ga-action="Editors 9 Picks" data-ga-label="KeepsakeTheLabel" onClick="_gaq" rel="teaser.index.Essentials.75x60.Editors9Picks.KeepsakeTheLabel"> <img data-interchange="[http://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)]"> <span class="essential-item"> Keepsake the Label<br/>a $189.95 </span> </a> </div> <div class="brand small-4 columns"> <a href="/Frill-Knit-Cami-170206.html" class="ga-track-link-click" data-ga-category="Women Gender Page" data-ga-action="Editors 9 Picks" data-ga-label="Bardot" onClick="_gaq.push rel="teaser.index.Essentials.75x60.Editors9Picks.Bardot"> <img data-interchange="[http://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)]"> <span class="essential-item"> Bardot<br/> $39.99 </span> </a> </div> </div> </div>'; preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $string, $match); echo "<pre>"; print_r($match); echo "</pre>";
based on lbZa6
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
<pre>Array ( [0] => Array ( [0] => http://static.theiconic.com.au/cms/site_updates/Week [1] => http://static.theiconic.com.au/cms/site_updates/Week [2] => http://static.theiconic.com.au/cms/site_updates/Week [3] => http://static.theiconic.com.au/cms/site_updates/Week [4] => http://www.theiconic.com.au [5] => http://img1.theiconic.com.au/m4vHwoKT2A1yyg1jDWVpBWpp8uc=/trim/fit-in/490x627/filters:quality(95) [6] => http://img1.theiconic.com.au/cSIL4OOfsfSWcOLqsdHfXie83UU=/trim/fit-in/490x627/filters:quality(95) [7] => http://img1.theiconic.com.au/D8k6ZV8RDzBoXTCRBc2m5wpX2_8=/trim/fit-in/490x627/filters:quality(95) ) [1] => Array ( [0] => k [1] => k [2] => k [3] => k [4] => u [5] => [6] => [7] => ) ) </pre>