-
Completed at: 2023-04-10T06:37:24.636Z
-
Completed languages: javascript
-
Tags: Parsing, Regular Expressions
-
Rank: 5 kyu
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"