Detect the Domain Name

  • + 0 comments
    html = sys.stdin.read()
    
    pattern = r'https?://(?:www\.|ww2\.)?([\w-]+\.[a-zA-Z0-9.-]+)'
    
    rs = set(re.findall(pattern,html))
    
    print(";".join(sorted(rs)))