Detect the Email Addresses

  • + 0 comments

    Enter your code here. Read input from STDIN. Print output to STDOUT

    this works for me

    import re import sys

    html= sys.stdin.read()

    pattern= r'\w*.?\w+@\w+.?\w*.?\w*.?\w+'

    matches=re.findall(pattern,html)

    output=sorted(set(email for email in matches))

    print(';'.join(output))