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
re, err := regexp.Compile(`([-a-z0-9])+[.](.*)domain.com`)
The issue is that for a string such this below the whole string is Found instead to get the specific sudomains extracted such prefix1-prefix2.domain.com
so the question is what regexp do I need to get only the subdomains without the extra string (i.e %2Fdocument...
)
prefix1-prefix2.domain.com%2Fdocument%2F%3Fusp%3Dmkt_docs%26lng%3Den&followup=https%3A%2F%2Fprefix1-prefix2.domain.com%2Fdocument%2F%3Fusp%3Dmkt_docs%26lng%