$re = '/^[^.\n]*[^\/\n]*\.\K[^\/\n]+/m';
$str = 'https://www.example.org/
http://example.com/
ca.gov
http://blade.example.com/bikes/airplane.php
http://alarm.example.com/
smugmug.com
shop-pro.jp
https://example.org/
qq.com
pcworld.com
symantec.com
360.cn
http://example.com/?brother=bike
http://www.example.com/behavior/bead.php
army.mil
https://example.com/boy/bedroom.php
https://example.com/
https://www.example.com/brother?activity=believe
https://www.example.net/achiever/bottle.html
http://believe.example.com/bit?bait=base&bone=ball
aboutads.info
http://www.example.com/
http://www.example.edu/afternoon
livejournal.com
http://border.example.com/box/afterthought
oaic.gov.au
https://www.example.edu/base.php
house.gov
smh.com.au
http://www.example.edu/
https://www.example.org/
lycos.com
https://border.example.com/?bridge=basket&blood=animal
hibu.com
http://example.com/';
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