Answers for "get domain name with regex"

0

get domain name with regex

const urls = [
  'www.abc.au.uk',
  'https://github.com',
  'http://github.ca',
  'https://www.google.ru',
  'http://www.google.co.uk',
  'www.yandex.com',
  'yandex.ru',
  'yandex',
  'devmaster.auxitaplatform.com',
]

urls.forEach(url => console.log(url.replace(/.+\/\/|www.|\..+/g, '')))
Posted by: Guest on August-03-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language