4 ms·
That regexp would allow a hyphen as the first character. How about this (still assuming .com is the only permitted TLD): [a-z0-9][a-z0-9-]*[a-z0-9].com$
by ratsbane 18y ago
That regexp would allow a hyphen as the first character. How about this (still assuming .com is the only permitted TLD):
[a-z0-9][a-z0-9-]*[a-z0-9].com$