title: How to write regex for domain validation that will trigger pattern error in Angular form
body: <p>I am validating a domain field in the form. I am using <code>Validators.pattern(this.domainPattern)</code> for doing that. 
  I am using below pattern:</p>
  
  <pre><code>public domainPattern: string = "^(?:[a-z0-9][a-z0-9-]{0,61}[a-z0-9]\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$";
  
  </code></pre>
  
  <p>It works fine for many cases. But when there is a white space in domain it is not triggering pattern error. What I am missing?</p>
  
  <p>Quick help will be highly appreciated.</p>
  
  <p>Thanks.</p>