+ Start a Discussion

Validation Rule to Avoid Special characters except comma(,) fullstop(.) space( ) and Enter key.

Hi Can any one help me on this, I have created validtion rule which avoids the special characters except comma(,) fullstop(.) space( ), but i need to accept Enter key also(when i use enter key am getting error like please avoid special characters , even though am using enter key am not supposed to get this error). 

THis is my validation rule am using  NOT(REGEX( Description,"^[a-z A-Z 0-9,.]*$" )) 

Tolga SunarTolga Sunar
Try this -->  NOT(REGEX( Description,"^[a-zA-Z0-9,.]{1,}$" )) 

Not sure on the enter key though. Please tell if validation rule above does not let you put enter key.
Thnx Sunar , but still it is not accepting enter key 
Tolga SunarTolga Sunar
Try this --> NOT(REGEX(Description,"^[a-zA-Z0-9,. \r\n]{1,}$"))

Tested in my developer org, it works. However, if the last characher is a new line in your string, it will throw error.
Sandeep TantravahiSandeep Tantravahi
NOT( REGEX( Description , "[a-zA-Z0-9.,@'$?_&#\\s]+")) . This should work 
Paula Jarvis 18Paula Jarvis 18
What does the first part of the code mean? - a-zA-Z 
Does this limit the characters to proper case?