+ Start a Discussion

Regular expressions for Phone number Validation

phone number should accpet only one + symbol at the starting followed by 10 digit number it should not accept +   in the middle or end .
 "^\\D*+([0-9 ]+)*"
 it accepting + symbol at starting .
Amit Chaudhary 8Amit Chaudhary 8
Please try below example.

Example 1:- NOT( OR( ISBLANK(Phone), REGEX( Phone,"(\\D?[0-9]{3}\\D?)[\\s][0-9]{3}-[0-9]{4}")))

Example 2:-

Example 3:-
https://help.salesforce.com/apex/HTViewSolution?id=000187896&language=en_US (https://help.salesforce.com/apex/HTViewSolution?id=000187896&language=en_US)

Please let us know if now this will help u
Igor PetrovychIgor Petrovych
If you need a more advanced validation of a number, to make sure you really have a valid number - you can do that in the trigger handler, and use a ported libphonenumber (http://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000G12oJUAR) library.