• Curtis Constant 3
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi!

I would love to get some quick help with this validation rule:

NOT( 
OR( 
ISBLANK(Last_Name__c),REGEX(Last_Name__c ,"([a-zA-Z-])*")))

What I want is for Last Name to include only a-z, A-Z, hyphens or spaces. 

When I first wrote it as this: REGEX(Last_Name__c ,"([a-zA-Z])*")))  -- without the hyphen, I was getting it to work to allow spaces. However, once I added the hyphen in, the hyphen was allowed but spaces were no longer allowed. 

What am I doing wrong here? 

Thanks!
Stephanie