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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find U.S. Social Security Numbers
Expression
[/,,/.,/=,\s]([0-6]\d{2}|7[0-6]\d|77[0-2])(\s|\-)?(\d{2})\2(\d{4})[/,,/.,\s]
Description
Searches for US SSNs that have either a white space, ".", ",", or "=" in front and either a white space, ".", or "," at the end. Ensures that sets are separated with the same format (either spaces, dashes, or nothing).
Matches
123-45-6789 | 123456789 | 123 45 6789 | =123-45-6789 | .123456789 | end. 123 45 6789
Non-Matches
&123-45-6789 | 1234567890 | 123 45 6789z | 123-456789 | 12345-6789
Author Rating: The rating for this expression. John Stoker
Source John Stoker
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: Only woking with dashes
Name: Joey
Date: 8/17/2011 6:05:47 PM
Comment:
This is only working for me if it is 123-45-6789 format.


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