Fully qualified domain name validation
(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}$) regex is always going to be at best an approximation for things like this, and rules change over time. the above regex was written with the following in mind and is specific to hostnames– Hostnames are composed of a series of labels concatenated with dots. Each label is 1 to 63 characters long, and … Read more