You need to sign in to do that
Don't have an account?
Venkata Sravan Kumar Bandari
can anyone please give me the Regex code for the phone number format (XXX)XXX-XXXX
can anyone please give me the Regex code for the phone number format (XXX)XXX-XXXX
1) http://sfdc2u.blogspot.in/2013/08/phone-number-validation-in-salesforce.html
Option 2:-
http://forceguru.blogspot.in/2011/05/validation-over-apex.html
http://forcemonkey.blogspot.in/2011/01/coverting-code-to-button-clicks.html
Let us know if this will help you
All Answers
You can use this:-
/^(?:\(\d{3}\)|\d{3}-)\d{3}-\d{4}$/
Please find the link.
http://stackoverflow.com/questions/13679310/validation-for-xxx-xxx-xxxx-or-xxxxxx-xxxx
Best Regards,
BALAJI
Option 1:-
US Phone Number Has Ten Digits:-
Validates that the Phone number is in (999) 999-9999 format. This works by using the REGEX function to check that the number has ten digits in the (999) 999-9999 format.
Option 2:-
Validation Rule for 10 Digit US phone number with 4 digit extension
https://help.salesforce.com/apex/HTViewSolution?id=000187896&language=en_US
Option 3 :-
10 digits
no spaces
no dashes or parenthesis This means that "Only Allow 10 digits". d - stands for DIGITS and {10} - just 10 of them.
Let us know if this will help you
Thanks
Amit Chaudhary
tried with
pattern.matches('(123)123-1234', '\\D*?(\\d\\D*?){10}');
it is giving false
How to use it in Apex code. I have requirement in apex
1) http://sfdc2u.blogspot.in/2013/08/phone-number-validation-in-salesforce.html
Option 2:-
http://forceguru.blogspot.in/2011/05/validation-over-apex.html
http://forcemonkey.blogspot.in/2011/01/coverting-code-to-button-clicks.html
Let us know if this will help you
For Example: If you try with You will get true.
I would like to know whether it helped you
Best Regards,
BALAJI