URL: [subdomain.domain.com...]
Proper domain: domain.com
Thanks for any help.
m#^(?:\w+\://)?(?:[\w\_\-]+\.)*([\w\_\-]+\.[a-z]{2,3})\b#i and $match = $1;
(?:\w+\://)? - Matches & sets aside "http://" "https://" "ftp://" etc., if found
(?:[\w\_\-])* - Matches & sets aside 1 or more subdomains, if found
([\w\_\-]+\.[a-z]{2,3}) - Matches domain - n characters followed by a dot, followed by 2 or 3 characters (i.e., a top level domain)
This should work unless you are matching domains with strange characters in them. "Strange" here means anything besides a letter, number, hyphen, or underscore.