3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "The text you want to filter goes here. http://google.com, https://www.youtube.com/watch?v=K_m7NEDMrV0,https://instagram.com/hellow/"; preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $string, $match); echo "<pre>"; print_r($match[0]); echo "</pre>";

preferences:
60.05 ms | 402 KiB | 5 Q