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
Wil PhoWil Pho 

validation rule to prevent non-alphanumeric characters

Hi there,

I'm trying to create a validation rule to prevent accounts from being created in our Community Cloud site whose account name contains non-alphanumeric account names. Getting a lot of fake accounts. For example, I want to prevent Asian characters in the account names. I tried various versions. 

I tried these: 

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

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

They blocked this name: "wil test" for some reason. 

Appreciate any help!

Wil
CharuDuttCharuDutt
Hii Will Pho
Try Below Validation Rule
NOT(REGEX( Name , "[a-zA-Z0-9 ]*$"))
Please Mark it As Best Answer If It Helps
Thank You!

 
PINKY REGHUPINKY REGHU
Hi Will,

Try using the one given below 
NOT( REGEX( Name , "[A-Za-z0-9 ]*") )


Please Mark it As Best Answer If It Helps.