^(9[0-9][0-9]|666|000|078051120|219099999|123456789|123121234|321214321) the second section ensures that the 2 digit portion isn't 00 ^([0-8][0-9][0-9]00) The third section ensures that the last portion isn't 0000 ^([0-8][0-9][0-9][0-9][0-9]0000) We additionally check to make sure they have inputted a number, and that they aren't just using a repeated number.As of the randomizing of social security numbers post-911, the entries in the 900 series and even 666 are now potentially valid numbers.Let's look at a simple break-down of this expression : ^ # Beginning of expression \d # Exactly three digits (denoted by \d and the specifies the number) - # An explicit 'dash' \d # Exactly two digits - # Another explicit 'dash' \d # Exactly four digits $ # End of expression This doesn't take into consideration any of the previously suggested rules and exceptions that were mentioned above, but it does function to ensure that the number is in the proper format.You can see an example of this in action below : While this may not look very fun at all, it will validate any valid Social Security Number as per the constraints (and exceptions) listed by the Social Security Administration.Also there are a few specific numbers to invalidate according to this link: how I did it.I could have used regexes for repeating numbers, but with specific ones to invalidate we might as well add ones through fives to that list (over 5 will invalidate anyways due to area number validation).
Previously unassigned Area Numbers have been introduced for assignment excluding Area Numbers 000, 666 and 900–999.
Make note of your the User ID, password and expiration date.
Anyone out there know how to improve this function?
Enter a social security number to validate that it is in the correct format.
Additionally, we will tell you what state issued the social security number.
Search for validating ssn:
A Social Security number (SSN) is a nine-digit number issued to U. citizens, permanent residents and temporary residents under section 205(c)(2) of the Social Security Act.