+ Start a Discussion
KotiSFDCKotiSFDC 

To accept only characters i wrote Validation as bellow :NOT(REGEX(Name__c ,"[a-zA-Z]"))....... But its not allowing characters too

Best Answer chosen by KotiSFDC
{!Piyush_soni__c}{!Piyush_soni__c}
meaning of use * after [a-zA-Z] is that any character can repeat from from a to z in Name field.

if you got your answer then close your query by choosing best answer
Thanks

All Answers

Suraj TripathiSuraj Tripathi

Hi KotiSFDC,
Try using this Expression .
/^[a-zA-Z]*$/
Change the * to + if you don't want to allow empty matches.​

Hope it Helps you. Please mark this as solved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Regards ,
Suraj
KotiSFDCKotiSFDC
NOT ( REGEX ( Name__c,"[a-zA-Z]*" ))
it allows space, requirment is not allow space too
{!Piyush_soni__c}{!Piyush_soni__c}
hi this validation rule work fine in my org , please validate it again :
NOT ( REGEX ( Name__c,"[a-zA-Z]*" ))
User-added image
it's not allow the space
 
KotiSFDCKotiSFDC
Thank you piyus, can u plz tell me  why we can add * after [a-zA-Z]
{!Piyush_soni__c}{!Piyush_soni__c}
meaning of use * after [a-zA-Z] is that any character can repeat from from a to z in Name field.

if you got your answer then close your query by choosing best answer
Thanks
This was selected as the best answer