I am using python and would like a simple api or regex to check for a domain name\'s validity. By validity I am the syntactical validity and not whether the domain name actu
The answers are all pretty outdated with the spec at this point. I believe the below will match the current spec correctly:
r'^(?=.{1,253}$)(?!.*\.\..*)(?!\..*)([a-zA-Z0-9-]{,63}\.){,127}[a-zA-Z0-9-]{1,63}$'