I've been finding url from text by preg_match with this pattern /(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/
Any further solutions for detecting domains instead of url? May be with a list of top-level domain like this: .asia .biz .cat .com .net .edu .gov .info .com.eu .com.au
//Edit
For example I have a paragraph like this:
Hello world. https://stackoverflow.com/posts/22112284/edit
And I want to find this domain stackoverflow.com in that text.