Hi I have this regex to match ursl, but i need to match subdomains too.
public function getUrls($url){
preg_match_all( "#(www\.|https?:\/\/){1}[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\S*)#i",$url, $matches );
return $matches[0];
}
this match http://domain.com but not http://sub.domain.com
Any idea how to make it work?