I have two types of addresses in DataBase:
url_1 = "http://country.city.street/"
url_2 = "http://country.city.street:8180/"
I need to get a uniform address format (url_pattern = "country.city.street") to use in a DNS server. I removed the http:// part from the beginning but can't get a good result with the end of the address. Does anyone have an idea what I could use to get a url_pattern standard?
url_1 = "http://country.city.street/"
url_2 = "http://country.city.street:8180/"
url_1 = url_1[7:]
url_2 = url_2[7:]
https://...address.split()a few times:url = address.split('/')[2].split(':')[0].match = re.search(r'//(?P<base>.+?[:/])', address); url = match.group(1).