function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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:- (

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 ( library.
Debanshu KarDebanshu Kar
I have a Requirement that in Flow I need to create a text element for a mobile number with the below validation criteria:
Text data type
-Must have 10 digits
-Cannot have same number repeated more than 4 times eg; 9999988888- this number must not be accepted. We should show an error message saying “please enter correct/valid phone number.”
-Cannot have more than 4 consecutive or successive numbers eg; 9773312345 or 7891234567. This should not be allowed