Skip to content

Latest commit

 

History

History

extract-the-domain-name-from-a-url-1

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
  • Completed at: 2023-04-10T06:37:24.636Z

  • Completed languages: javascript

  • Tags: Parsing, Regular Expressions

  • Rank: 5 kyu

Description

Write a function that when given a URL as a string, parses out just the domain name and returns it as a string. For example:

* url = "http://github.com/carbonfive/raygun" -> domain name = "github"
* url = "http://www.zombie-bites.com"         -> domain name = "zombie-bites"
* url = "https://www.cnet.com"                -> domain name = cnet"