0

I am new to salesforce . I have MobilePhone field in Contact. I need to validate the MobilePhone Field such that it must include (+1, +91, +355) followed by 10 digits mobile number.

NOT(REGEX(MobilePhone, "\D*?(\d\D*?){10}")) - This Regex works for 10 digits. How can I write this regex with country code using validation Rule. Ex: +19878767657 , +919878787678

1 Answer 1

0

Use [+][0-9]{1,3}[0-9]{10}


[+] to check '+' at start

[1-9]{1,3} to check up to 3 digits for Country code

[0-9]{10} to check 10 digits for Phone Number


1
  • NOT(REGEX(MobilePhone, "[+][0-9]{1,3}[0-9]{10}")) This regex is working Commented May 20, 2022 at 10:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .