title: regex match subdomain
body: <p>I need a regex that matches all the subdomains of a specific domain. The content media type is unknown (i.g. may be urlencoded, json etc)
  So far I've got this simple regex 
  <code>re, err := regexp.Compile(`([-a-z0-9])+[.](.*)domain.com`)</code></p>
  
  <p>The issue is that for a string such this below the whole string is <a href="https://golang.org/pkg/regexp/#Regexp.FindAll" rel="nofollow noreferrer">Found</a> instead to get the specific sudomains extracted such <code>prefix1-prefix2.domain.com</code> so the question is what regexp do I need to get only the subdomains without the extra string (i.e <code>%2Fdocument...</code>) </p>
  
  <p><code>prefix1-prefix2.domain.com%2Fdocument%2F%3Fusp%3Dmkt_docs%26lng%3Den&amp;followup=https%3A%2F%2Fprefix1-prefix2.domain.com%2Fdocument%2F%3Fusp%3Dmkt_docs%26lng%</code> </p>