1const urls = [
2 'www.abc.au.uk',
3 'https://github.com',
4 'http://github.ca',
5 'https://www.google.ru',
6 'http://www.google.co.uk',
7 'www.yandex.com',
8 'yandex.ru',
9 'yandex',
10 'devmaster.auxitaplatform.com',
11]
12
13urls.forEach(url => console.log(url.replace(/.+\/\/|www.|\..+/g, '')))