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

Phone Validation / REGEX[

We have a number of problems with phone number entries, our contacts integrate with another system and we are having failures due to unseen characters being entered into phone numbers... these seem to happen when numbers are copy paste into salesforce.


The user cannot see them and is not aware, sometimes this can simply be a leading or trailing 'space'.. I want to add validation that will ensure numbers are added and cannot be saved with these present, Im wondering the best way to do it as there are so many different ways to enter a phone number, is there a REGEX for it? We mainly work on UK numbers but could have to add international. Thanks

Steve :-/Steve :-/

There are example of Phone Validation Rules including REGEX in the Formulas Guidebook.



hi Ladykb27,


There is a international format for the phone numbers, ' LEFT(Phone, 1) <> "+" ' which cheks whether the country code followed by the plus sign is in front of the number or not and it may conflict with the ten digit rule.


This could by handy as well to make sure that phone, fax, mobile they contain only numbers and follow the regular formatting of phone fields.


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