title: Regex for domain validation
body: <p>I have seen a similar question asked here <a href="https://stackoverflow.com/questions/7916370/jquery-how-to-validate-domain-name">Jquery how to validate domain name</a> but I cannot seem to get this example to work with my code.</p>
  
  <p>I would basically like to perform a reg ex against an input text box, and validate via jquery to see if it matches my search criteria for a domain name. The format must be</p>
  
  <p>domainname.co.uk or .com/.org/.net (no http:// or https:// and no subdomain)</p>
  
  <p>My code currently :</p>
  
  <pre><code>if(!/([a-z0-9-]+\.(?:com|net|org|co.uk))(?:\/|$)/$("#domain").val()) {
          $('#error').html("Invalid domain name, , please correct before proceeding.");
          return false;   
  }
  </code></pre>