I got a list of links and some of them look like
https://www.domainname
or https://domainname
I need to make a regex pattern to get only the domain name from it. This "www" make problems in my pattern :(
print(re.findall("//([a-zA-Z]+)", i))
I got a list of links and some of them look like
https://www.domainname
or https://domainname
I need to make a regex pattern to get only the domain name from it. This "www" make problems in my pattern :(
print(re.findall("//([a-zA-Z]+)", i))
re.findall(r"//(?:www\.)?([a-zA-Z]+)", i)