how should be valid domain name regex which full fill following criteria.
- each label max 63 characters long minimum 1 characters
- contains numbers, letters and '-', But
- should not start and end with '-'
- max domain name length 255 characters minimum 1.
for example
some of valid combinations:
a
a.com
aa-bb.b
I created this ^(([a-z0-9]){1,63}\.?){1,255}$
But currently its not validating '-' part as required (it's , missing)
Is there any way?
plz correct me if I am wrong.