+ Start a Discussion
Shree KShree K 

How to limit the size of the value in the fields?

how to write a validation rule to let the users enter exactly 8 characters not less than 8 not more than 8 (4 Alpha-4 numeric) in a text field,

Thanks in Advance

You can use below condition in Validation rule, and it will throw the exception if the length of value is more than 8 or less than 8 and also check the pattern should be alph numeric.

NOT( REGEX( FIELD_NAME, "[a-zA-Z0-9_+-]+")) 

Ashlekh Gera
James WooleyJames Wooley
If you want exactly 4 alpha follwed by 4 numeric, the following validation rule should work:

NOT( REGEX( FIELD_NAME, "[a-zA-Z]{4}[0-9]{4}"))

If you wanted only upppercase for the aplha you could use:

NOT( REGEX( FIELD_NAME, "[A-Z]{4}[0-9]{4}"))