extract domain from url using regex code example
Example: javascript regex get domain from url
function url_domain(data) {
var a = document.createElement('a');
a.href = data;
return a.hostname;
}
function url_domain(data) {
var a = document.createElement('a');
a.href = data;
return a.hostname;
}