I haven't been able to find this one and what I'm trying isn't quite working out for me.
I want to match only domains that:
- don't contain a protocol (http, https, ftp)
- optionally include a subdomain
- don't start with a hyphen but can contain a hyphen
Example domains that would match:
Example domains that would not
What I've currently got:
It's not matching protocols, allowing hyphen inside the domain, not allowing trailing characters after the TLD, and is allowing a subdomain (but only 1 character).
I still need to allow subdomains of any length, not allow www.subdomain.domain.com and not allow a leading hyphen.