Ad
  • Custom User Avatar

    well I am a beginner so I can not fully tell if it's a good question or not but with regex you can get the Domain as long as you write right Regex it dose not matter what domain contains as long as it contain a "." after Domain for ex:- "youtube.notcom/mypage"

  • Custom User Avatar

    I agree, this is not a good question right now. Without a given list of second level domains it is not possible to extract the "domain" (which is also not the correct name as pointed out by others). For example: www.museum.tt should return "www", because "mesuem.tt" is actually a SLD that can be registered (same as .co.uk). There is a npm packages that solves this problem:
    https://github.com/lupomontero/psl

    As mentioned it contains a complete list of all registerable SLD's.