5 kyu
Extract the domain name from a URL
3,794 of 84,807xianpants
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"
Parsing
Regular Expressions
Similar Kata:
Stats:
Created | Mar 20, 2013 |
Published | Mar 21, 2013 |
Warriors Trained | 166588 |
Total Skips | 25147 |
Total Code Submissions | 538736 |
Total Times Completed | 84807 |
Ruby Completions | 3794 |
Python Completions | 43201 |
JavaScript Completions | 38314 |
COBOL Completions | 12 |
Total Stars | 2693 |
% of votes with a positive feedback rating | 83% of 6385 |
Total "Very Satisfied" Votes | 4684 |
Total "Somewhat Satisfied" Votes | 1286 |
Total "Not Satisfied" Votes | 415 |