We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Detect the Domain Name
Detect the Domain Name
+ 0 comments import re is_domain = re.compile(r"https?://(www\.|ww2\.)?(([a-z0-9\-]+\.)+[a-z0-9\-]{2,})") domains = set([domain[1] for _ in range(int(input())) for domain in is_domain.findall(input())]) print(";".join(sorted(domains)))
+ 0 comments regex_pattern=r'(?:https?://(?:ww.\.)?)([\w\-.]*\.[a-zA-Z]+[^\W\_])'
+ 0 comments Python 3
import sys import re string = sys.stdin.read() matches = re.findall(r'https?:\/\/(?:www\.|ww2\.)?([^\/\.\s]*\.[^\/\\\?_"\'\s]*)', string) print(';'.join(sorted(set(matches))))
+ 0 comments Python 3
import re p = re.compile(r'https?://(w{3}|ww2)?(\.)?([a-z\d\-]+)(\.[a-z\d\-]+)+') s = ' '.join([input() for _ in range(int(input()))]) print(';'.join(sorted(set([i.group().replace('http://', '').replace('https://', '').replace('www.', '').replace('ww2.', '') for i in re.finditer(p, s)]))))
+ 0 comments import re import sys N = int(input()) S = sys.stdin.read() List = sorted(set(re.findall(r'(?<=://)[\w\d-]+[\.]+[\w\.-]+',S))) for i in range(len(List)): List[i] = re.sub("www.","",List[i]) List[i] = List[i].rstrip("_") print(*sorted(set(List)),sep=";")
Load more conversations
Sort 157 Discussions, By:
Please Login in order to post a comment