Print this page

How can we check that an email address is in a valid format?

Knowledge Article Number 000170904
Description We would like to create formula syntax that checks whether a field value is formatted as a valid email address.
Resolution For the local part of the email address we accept the following characters. The local part is anything before the @ sign. 


Note: The character dot “.” is supported; provided that it is not the first character in the local-part

For the domain part of the email address we accept. The domain part is anything after the @ in an email address: 

0-9 and A-Z and a-z and dash “-“ 

Example email address: 

Additional information: 
RFC 2822: 
RFC 2821: 
RFC 821: 

Based on this information, you could ensure that an email address is in a format which will consider valid by using a REGEX with syntax like: 

REGEX ( UPPER ( EmailField__c ) ,"^[A-Z0-9._%+-/!#$%&'*=?^_`{|}~]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$")

Also the below mentioned syntax can be used:

NOT(REGEX ( UPPER ( Field ) ,"^[A-Z0-9._%+-/!#$%&'*=?^_`{|}~]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$")) 
NOT(REGEX( Custom_Email_Field__c ,'([a-zA-Z0-9_\\-\\.]+)@((\\[a-z]{1,3}\\.[a-z]{1,3}\\.[a-z]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})')) 

These two formulas would ensure that all text added on the email field will be consisting of a regular text, followed by the "@" sign, then the domain, followed by the ".com" suffix.

promote demote