3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sentence = 'This www.google.com is the http://www.asda.facebook.com website that https://www.amazon.com make me awesome'; $pattern = '@((https?://)?([-\\w]+\\.[-\\w\\.]+)+\\w(:\\d+)?(/([-\\w/_\\.]*(\\?\\S+)?)?)*)@'; preg_match_all($pattern, $sentence, $matchFound); echo '<pre>'; print_r($matchFound[0]);
based on InAu1
Output for 5.6.0 - 5.6.30, hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.3.0beta1
<pre>Array ( [0] => www.google.com [1] => http://www.asda.facebook.com [2] => https://www.amazon.com )