You are viewing a single comment's thread. Return to all comments →
JS Solution :
function processData(input) { var data = input.split('\n'); var n = parseInt(data[0]); var text = data.slice(1).join(' '); console.log(detectDomains(input).sort().join(';')); } var detectDomains = function(input) { var domainRE = /https?:\/\/(ww[w2].)?([-\w.]+\.[a-z]+)/ig; var domains = new Set(); input.replace(domainRE, function(_,__,domain) { domains.add(domain) }) return Array.from(domains); }
Seems like cookies are disabled on this browser, please enable them to open this website
Detect the Domain Name
You are viewing a single comment's thread. Return to all comments →
JS Solution :