title: Parsing string for Domain / hostName
body: <p>Out customers can enter websites from domain names. They also can enter mailadresses from their contacts.</p>
  
  <p>Know we need to find customers which websited whoose domain can be associated to the domains of the mailadresses.</p>
  
  <p>So my idea is to extract the host from the webadress and from the url and compare them</p>
  
  <p>So what's the most reliable algorithm to get the hostname from a url?</p>
  
  <p>for example a host can be:</p>
  
  <pre><code>foo.com
  www.foo.com
  http://foo.com
  https://foo.com
  https://www.foo.com
  </code></pre>
  
  <p>The result should always be foo.com</p>