title: Javascript/Regex for finding just the root domain name without sub domains
body: <p>I had a search and found lot's of similar regex examples, but not quite what I need.</p>
  
  <p>I want to be able to pass in the following urls and return the results:</p>
  
  <ul>
  <li><p><strong>www.google.com</strong> returns <strong>google.com</strong></p></li>
  <li><p><strong>sub.domains.are.cool.google.com</strong> returns <strong>google.com</strong></p></li>
  <li><p><strong>doesntmatterhowlongasubdomainis.idont.wantit.google.com</strong>
  returns <strong>google.com</strong></p></li>
  <li><p><strong>sub.domain.google.com/no/thanks</strong> returns <strong>google.com</strong></p></li>
  </ul>
  
  <p>Hope that makes sense :)
  Thanks in advance!-James</p>