SSN Validation rule
Recently we come up with requirement where we need to validate Social security number. Here it is for you all. Before that i want to elaborate on structure of SSN number. it is nine-digit number in the format "AAA-GG-SSSS".The number is divided into three parts first part denotes the Area and middle 2 digit is Geo and last four digits are Serial Numbers that represents a numerical sequence of digits from 0001-9999.
Not(OR(LEN(SSN__c)=0,REGEX(SSN__c,"[0-9]{3}-[0-9]{2}-[0-9]{4}"))).