Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/debapriyasengupta28/domain-extraction
Extracting domains from lengthy strings of URLs can be cumbersome. Instead of manually sifting through extensive text to isolate site addresses, utilize this system to efficiently extract the site URL from any length URL string. Test cases are provided in the readme file for convenience
https://github.com/debapriyasengupta28/domain-extraction
Last synced: 8 days ago
JSON representation
Extracting domains from lengthy strings of URLs can be cumbersome. Instead of manually sifting through extensive text to isolate site addresses, utilize this system to efficiently extract the site URL from any length URL string. Test cases are provided in the readme file for convenience
- Host: GitHub
- URL: https://github.com/debapriyasengupta28/domain-extraction
- Owner: DebapriyaSengupta28
- Created: 2024-02-25T14:07:26.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-03T11:05:14.000Z (8 months ago)
- Last Synced: 2024-04-03T12:25:48.067Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Domain-Extraction
Extract Domains from long string of URLs.
# Test cases
```
console.log(extractDomain("https://studio.youtube.com/channel/UCntj-iDUfMBvc8_peZWbQ4g/editing/sections"));
// Output: studio.youtube.comconsole.log(extractDomain("https://www.youtube.com/"));
// Output: www.youtube.com
console.log(extractDomain("https://www.youtube.com/channel/UCntj-iDUfMBvc8_peZWbQ4g"));
// Output: www.youtube.com
console.log(extractDomain("https://www.flipkart.com/helpcentre?otracker=${otracker}_navlinks"));
// Output: www.flipkart.com
console.log(extractDomain("www.flipkart.com?web=true"));
// Output: www.flipkart.com
console.log(extractDomain("https://aniwatchtv.to/watch/ninja-kamui-19018?ep=119953"));
// Output: aniwatchtv.to```