$re = '/((\w+\.\w+)(?=\/))|((?<=\.)|(?<=\/\/))((\w+\.\w+)\n)/';
$str = 'http://xsi82.com
http://www.xsi82.com
http://xsi122.com/view/8383.html
http://xsi122.info/view/8383.html
http://sdf242.com/view/4483.html
http://www.xsi122.com/view/8383.html
http://ww3.sdf242.com/view/4483.html
http://oudi38.com/view/182483.html
https://83jsla.com/forum/view1234.html
https://hello192.com/page/hello.html
http://hsl1092.in/world';
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