I need to be able to identify a domain name of any subdomain.
Examples:
For all of thiese I need to match only example.co
/ example.com
This will match:
([0-9A-Za-z]{2,}\.[0-9A-Za-z]{2,3}\.[0-9A-Za-z]{2,3}|[0-9A-Za-z]{2,}\.[0-9A-Za-z]{2,3})$
as long as:
Bassically what it does is match any of these two:
Short version:
(\w{2,}\.\w{2,3}\.\w{2,3}|\w{2,}\.\w{2,3})$
If you want it to only match whole lines, then add ^ at the beginning
This is how I tested it: