$s = "website: https://www.collectivesolver.com/ Programming & Software Q&A";
$regex = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
preg_match($regex, $s, $url);
print_r($url);
/*
run:
Array
(
[0] => https://www.collectivesolver.com/
[1] => https
[2] => /
)
*/