I need a regex for a subdomain but I can't seem to find one and am useless at writing them.
I need a regex to match:
sub1.mydomain.com
sub1.mydomain.local
But not to match:
www.mydomain.com
www.mydomain.local
Or:
[any protocol]//[anysubdomain except www].mydomain.[anysuffix]
Anyone care to take a go at this one?
Update (what I have).
Yes I have just now:
^(?!.*www)[a-z]*(.)?([A-Za-z0-9_-]*)\.([A-Za-z]*)(.*)$
However I need "mydomain.com" to not match.