You need to sign in to do that
Don't have an account?

Validation Rule with Regex Statement: 10digit numbers separated by commas
Hey guys, there is a text field that I want to restrict so it only accepts 10 digit phone numbers separated by commas.
So far I have this, but it does not specify how many digits the numbers must be. So it allows any number of digits separated by commas (i.e. 123,12,1234,12345,etc). But I want to restrict it to comma separated 10-digit numbers (i.e. 4161231234,6470987657,9051231234,etc…). I know I need a “{10}” somewhere, but can’t seem to figure out where.
Your help is greatly appreciated.
AND(
NOT(ISBLANK(Text_Field__c)),
NOT(REGEX(Text_Field__c,"^[0-9,.*]+$"))
)
So far I have this, but it does not specify how many digits the numbers must be. So it allows any number of digits separated by commas (i.e. 123,12,1234,12345,etc). But I want to restrict it to comma separated 10-digit numbers (i.e. 4161231234,6470987657,9051231234,etc…). I know I need a “{10}” somewhere, but can’t seem to figure out where.
Your help is greatly appreciated.
AND(
NOT(ISBLANK(Text_Field__c)),
NOT(REGEX(Text_Field__c,"^[0-9,.*]+$"))
)
All Answers
American Phone Number (no extension) is 10 digits
!REGEX(Phone,"^((\\+1)?\\s?\\(\\d{3}\\)\\s?\\d{3}\\-\\d{4})?$")
If I wanted to allow spaces after the commas, how would this REGEX statement look? i.e 1231231234, 3213213214, 1231231234, etc..
There are no space or many spaces:
There are at least one space: