$re = '/((?:http:\/\/+|www\.+|https:\/\/+)(?:\W+|\S+|\s+|.+)(?:\.net+|\.ro+))/mi';
$str = 'glass shoes door window door glasses. window glasses sunglasses
glass
asdblog
{www.asdblog.iqads.net}
{http://creator.iqads.ro/NESCAFE3in1}
http://twitter.com/share
http://cdn.iqads.ro/photos/tags/11912.png
http://cluj.tecomm.ro/
http://www.godmother.ro
http://www.facebook.com/godmotherBTL
http://twitter.com/share
http://media.iqads.ro/2015/10/rm2hb-cover-400.jpg
http://media.iqads.ro/2015/09/vv-cover-800-cover-400.jpg
http://media.iqads.ro/2015/08/razvan-mitoiu-photo-cover-400.jpg
http://media.iqads.ro/2015/06/dsc7179-cover-400.jpg
http://media.iqads.ro/2015/05/raluca2-cover-400.jpg
http://media.iqads.ro/2015/05/1me-cover-400.jpg
http://cdn.iqads.ro/photos/tags/263355.png
http://cdn.iqads.ro/photos/tags/32786.png
http://cdn.iqads.ro/photos/tags/22703.png
http://cdn.iqads.ro/photos/tags/23589.png
http://cdn.iqads.ro/photos/tags/228683.png
http://cdn.iqads.ro/photos/tags/23696.png
http://cdn.iqads.ro/photos/tags/16968.png
http://cdn.iqads.ro/photos/tags/263192.png
http://www.blueidea.ro
http://www.blueidea.ro';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php