3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = " http://www.url1.com/ = ' http://www.url2.com/ 'http://www.url3.com/ <a href='http://www.url4.com/'>Testing1</a> <img src='https://url5.com'>Testing2</a>"; $url_regex = 'https?://[-\w()@:%+.~#?&;/=]+'; $regex = "`\s*=\s*['\"]?\s*$url_regex(*SKIP)(*FAIL)|$url_regex`i"; var_export(preg_match_all($regex, $html, $matches) ? $matches[0] : []);

preferences:
26.72 ms | 405 KiB | 5 Q