input: Write a python function to extract the domain name from a URL.
  assert extract_domain_name("https://www.example.com/path/to/page") == "www.example.com"
  assert extract_domain_name("http://subdomain.example.co.uk/path") == "subdomain.example.co.uk"
  assert extract_domain_name("ftp://example.org/resource") == "example.org"
  assert extract_domain_name("www.example.com/page") == "www.example.com"
  assert extract_domain_name("example.net") == "example.net"
output: def extract_domain_name(url):
      import re
      pattern = re.compile(r'^(?:https?:\/\/|ftp:\/\/)?(?:www\.)?([^\/]+)')
      match = pattern.search(url)
      return match.group(1) if match else url