Comment 3 for bug 105890

Revision history for this message
Soren Hansen (soren) wrote :

My test cases didn't consider a '-' at either end of each domainlabel.

This should do it:
regex = re.compile(r'^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.?)+$', re.IGNORECASE)