You need to sign in to do that
Don't have an account?
Stephanie Zimmerman 9
Regex Formula Validation to Require [A-Z][a-z] - and space
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
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
Try this one:
Notice the SPACE after HIPHEN in REGEX [a-zA-Z- ].
Hope that helps!
All Answers
Try this one:
Notice the SPACE after HIPHEN in REGEX [a-zA-Z- ].
Hope that helps!
AND(
Account.IsPersonAccount = FALSE,
Account.Name != "BCBSMA",
OR(
not(REGEX( LastName, "[a-zA-Z\\.\\ \\'\\-\\,]+")),
not(REGEX( FirstName, "[a-zA-Z\\.\\ \\'\\-\\,]+"))
)
)
how do I write a validation rule to prevent users from entering "Test" in the Opportunity Name field
The rule should fire when,
field = 'TEST'
field = 'test'
field = 'micro test opportunity'
field = 'micro-test'
should not fire when
field = 'protest'
field = testimony'
Thank you!