function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LogeshLogesh 

Restricting special characters in text field

Hi Friends,

I've a scenario where I need to restrict special characters such as (@,!<,>,?,+,=, %,#,(,),/,\,&,£,€,$, "") in text field. But it should accept alpha numeric character, white space & characters such as this (Á, Ñ, í, ó). Please help me with validation rule for this scenario.

Many Thanks
Logesh
Best Answer chosen by Logesh
LogeshLogesh
Thanks Satish_SFDC!  Indeed, I used REGEX, But I was looking out for perfect pre-defined classes, which I got it. Here is the expression with pre-defined class that will solve the scenario
[\\p{L}\\s\\d]*$

Many Thanks,
Logesh

All Answers

Satish_SFDCSatish_SFDC
You can use the CONTAINS Function or the REGEX to go ahead with this requirement.

Regards,
Satish Kumar
LogeshLogesh
Thanks Satish_SFDC!  Indeed, I used REGEX, But I was looking out for perfect pre-defined classes, which I got it. Here is the expression with pre-defined class that will solve the scenario
[\\p{L}\\s\\d]*$

Many Thanks,
Logesh
This was selected as the best answer