A field(Example__c, Text 255 char) can have a value of alphanumeric(numbers and/or letters) type and character length should ONLY be either:
- 3 character value
- 7 character value
- 12 character value
I have written the below validation rule:
AND( NOT( REGEX(Example__c,"[A-Za-z0-9]) ), OR( LEN(Example__c) <> 3, LEN(Example__c) <> 7, LEN(Example__c) <> 12 ) )
However while testing I see that although it's checking the alphanumeric validation but it's not checking the length at all. All values are getting saved no matter what the length is. I am unable to find what mistake I have made in the formula, please help.