Hi, it's me again. How would I go about using regex to match domain names and not subdomains nore full urls?

Domain: blah.com
Subdomain: sub.blah.com
Full Url: http://sub.blah.com

trying with this right now
Code:
$regex(domain,%text,/(\w+)\.(\w+)/g)
 


But it gives me subdomains too. Thanks in advance.