+ Start a Discussion

Validation Rule to check if a field contains specified characters

Hi All,


We have a requirement wherein a field can have any values between 0-9 or special characters comma,spaces,"+","-",";","/",".","(",")". Other than this a user should not be able to enter anything.


Need to write a custom validation rule for this. But not able to achieve the desired functionality. Please help me how to achieve it


Thanks in advance

Priya Nair


Can you include the source code you are currently using?


It looks like either a 



CONTAINS(FieldName, "Text") or NOT(CONTAINS(FieldName, "Text")




Formula sholud get you what you are looking for . 

This looks like might be a good candidate for the REGEX function.  Check it out in Help and Training (Search on REGEX)and this is a useful reference for the function and constructs Regex reference.

Can you please elaborate on how the REGEX works? I want to validate that a field contains letters and numbers but not spaces or special characters.