Match a basic domain or subdomain name.
Section: Validation Recipes
Domain name
regex
regex
^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,}$Explanation
Good for a simple domain shape check.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Validation Recipes