Now that we have gotten the short introduction out of the way explaining as to what the US Social Security Number is, let's have a look at it's format, and how to validate it.
in fron of it makes it check to see if it is a number.
well for one if you are checking the length of the ssn, if the value is longer than 9 it obviously has dashes, so non need to do validation twice.
Regular expressions can also be used to validate that the input conforms to a given format.
For example, we can use Regular Expression to check whether the user input is a valid Social Security number, a valid phone number or a valid email number, etc.