Write a function that when given a URL as a string, parses out just the domain name and returns it as a string. For example:
```python
domain_name("http://github.com/carbonfive/raygun") == "github" 
domain_name("http://www.zombie-bites.com") == "zombie-bites"
domain_name("https://www.cnet.com") == "cnet"
```
import re

def domain_name(url):
    pattern = "[\-\.a-z0-9]+|www.[\-a-z0-9]+\."
    string = re.findall(pattern, url)
    string = string[1 if len(string) > 1 and 'http' in string[0] else 0]
  
    return re.sub("www\.|\/\/|\.[\.a-z]+$|\.", "", string)

import re

def domain_name(url):
    pattern = "[\-\.a-z0-9]+|www.[\-a-z0-9]+\."
    string = re.findall(pattern, url)
    string = string[1 if len(string) > 1 and 'http' in string[0] else 0]
  
    return re.sub("www\.|\/\/|\.[\.a-z]+$|\.", "", string)
