title: Regex to validate against using a domain-name as the username
body: <p>I would like to avoid people registering a domainname as the username in my website. What is the good approach to validate against domain names ?</p>
  
  <p>So far i'm doing simple check against .com only :</p>
  
  <pre><code>if (username.endsWith(".com")) errorMessage(xxx);
  </code></pre>
  
  <p>But there are other domains like .co.id, etc and other rules about domain names that i'm not aware of. Is it sufficient to match only at the end of the string for a group of internet top-level-domains ?</p>