title: Validate top level domain from input with javascript
body: <p>How can I validate a domain name from a url input? I'm currently validating to <code>www.domain.com</code>, but need to be able to validate to just <code>domain.com</code>. So if a user enters <code>www</code> or <code>http://www.</code>, it needs to show the error. Also need to disable the content section from showing, unless the validation passes, instead of showing only if the input is not blank.</p>
  
  <p>Currently using: </p>
  
  <pre><code>var regExp = new RegExp("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-     
  9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$", "g");
  </code></pre>
  
  <p>but this is validating to <code>www.domain.com</code></p>
  
  <p>jsFiddle: <a href="http://jsfiddle.net/26hd2r9b/" rel="nofollow">Link</a></p>