Submitted by Alexander Dupuy - 2 years ago
Domain validation regex suitable for user input
This regexp can be used to validate domain names in Golang. While it cannot enforce the 253 character limit (with optional trailing period not included) that can be easily done by a simple len(domain) <= 253 check as well.
This can be used as-is in other languages, even with RE2 regex engine. If po...