Validation rule for blank space or white space in Salesforce

\\s is used in Validation rule for blank space or white space in Salesforce.

Sample Validation Rule:

AND( 
NOT(ISBLANK(Test__c)), 
AND(NOT(REGEX(Test__c, '\\d{14}')), 
NOT(REGEX(Test__c, '\\d{3}\\s{1}\\d{3}\\s{1}\\d{3}\\s{1}\\d{5}')) 

)

This will support only the below

12345678912345
or
123 456 789 12345

No comments:

Post a Comment