def is_email():
    """
    Validates that a fields value is a valid email address.
    """

    email = (
        ur'(?!^\.)'     # No dot at start
        ur'(?!.*\.@)'   # No dot before at sign
        ur'(?!.*@\.)'   # No dot after at sign
        ur'(?!.*\.$)'   # No dot at the end
        ur'(?!.*\.\.)'  # No double dots anywhere
        ur'^\S+'        # Starts with one or more non-whitespace characters
        ur'@'           # Contains an at sign
        ur'\S+$'        # Ends with one or more non-whitespace characters
    )

    regex = re.compile(email, re.IGNORECASE | re.UNICODE)

    def validate(value):
        if not regex.match(value):
            return e("{} is not a valid email address", value)
    return validate
Validates that a fields value is a valid email address.