Ask Search:
Chris JohnsChris Johns 

Validation rules to format text


I have a feild for medicare number and i want this to do a couple of things the field should only take 10 numbers however when the team enter the information i would like it to be formated as

#### ##### #

How can i achieve this?

Best Answer chosen by Chris Johns
Sunil SarillaSunil Sarilla
Hi Chris,
Create a Validation rule as below to ensure the reps always follow the same pattern when entering the medicare number
NOT(REGEX( Medicare_Number__c , "[0-9]{4}\\s[0-9]{5}\\s[0-9]{1}"))
Please use the insert field button to select the field API Name of Meidcare number field.