RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Social Security Number
Expression
^(00[1-9]|0[1-9][0-9]|[1-6][0-9][0-9]|7[0-6][0-9]|77[0-2]\-\d{2}\-\d{4})$
Description
A properly formatted US social security number. first three digits must be 001 - 772.
Matches
123-45-6789
Non-Matches
123456789 | 1234-56-7890 | 123-456-7890 | 123-45-67890
Author Rating: The rating for this expression. Ted Cambron
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Updated
Name: Ted Cambron
Date: 2/12/2008 10:02:36 PM
Comment:
I updated it so that the first three digits must be 001 - 772 like a real social security number.


Title: Can Be Improved
Name: Ted Cambron
Date: 2/11/2008 3:08:02 PM
Comment:
The first three digits should be 001 to 772. I will update later.


Copyright © 2001-2014, RegexAdvice.com | ASP.NET Tutorials