function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hari azmeera 8hari azmeera 8 

custom validation rule to check mobile number format, email format

Best Answer chosen by hari azmeera 8
Dutta SouravDutta Sourav
Hi Hari,

Try these:

Mobile Number Format:
NOT(REGEX( Mobile_Field__c , "\\D*?(\\d\\D*?){10}"))

//It also validates whether it is of 10 digits or not

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

Kind Regards,
Sourav.