title: regex - extract domain name and TLD
body: <p>I'm trying to extract domain name and TLD (if it exists) from a string.</p>
  
  <p>For "testing.co.uk" I want to have an array with values: ("testing", "co.uk")</p>
  
  <p>For "-testing.c" I want to have an array with a value: ("testing")</p>
  
  <p>For "test-ing.co.uk.com" I want to have an array with values ("test-ing","co.uk")</p>
  
  <p>Rules are simple:</p>
  
  <ul>
  <li>first and last character of the domain name can't be "-"</li>
  <li>TLD has to have at least two characters</li>
  <li>TLD part may have one dot character "." but only if it's followed by at least two letters</li>
  </ul>
  
  <p>I have this:</p>
  
  <ul>
  <li><code>(\w[-\w]*\w)</code> - First part that extracts the domain name (Working)</li>
  <li><code>\.(\w{2,}(\.?\w{2,})?)</code> - get the TLD (not working)</li>
  </ul>