Currently I trying to get a match given following conditions in a validation rule for Salesforce - If the number starts with any digits but 2 or 9, then the digit in the third position must be a 2 - The number must have exactly 9 digits - Repetitions of the same number are not allowed
This is the code I have, Is separated in three expresions because I'm not sure if I can have the same result in only one expression.
The Code I have copied is OK in syntax but is not matching correctly
OR( NOT(REGEX(Phone, "[0-9]{9}")),
REGEX(Phone, "([0-9])\\1{8}"),
REGEX(Phone, "\\b[0,1,3,4,5,6,7,8]{1}[0-9]{1}[0,1,3,4,5,6,7,8,9]{1}")
)