import re


def match_email(text):
    """Given a string, tries to find a regex match for an email."""
    email_regex = r'(.+\s+)*(<)*\s*(?P<email>\w+(?:.+\w+)*@\w+(?:.+\w+)' + \
                  r'(?:\.\w+)+)(>)*'
    match = re.match(email_regex, text)
    if match:
        return match.group('email')