We're a place where coders share, stay up-to-date and grow their careers.
No regex needed
function domainName(url){ return url.split("/")[2].split(".").slice(-2)[0] }
No regex needed