Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^\d{3}-\d{2}-\d{4}$ |
Description |
This regular expression will match a hyphen-separated Social Security Number (SSN) in the format NNN-NN-NNNN. |
Matches |
333-22-4444 | 123-45-6789 |
Non-Matches |
123456789 | SSN |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
(^|\s)(00[1-9]|0[1-9]0|0[1-9][1-9]|[1-6]\d{2}|7[0-6]\d|77[0-2])(-?|[\. ])([1-9]0|0[1-9]|[1-9][1-9])\3(\d{3}[1-9]|[1-9]\d{3}|\d[1-9]\d{2}|\d{2}[1-9]\d)($|\s|[;:,!\.\?]) |
Description |
Incorporated other people's examples; removed extraneous parenthesis on 10/7/04. Currently the SSA site says 772 is the highest AREA number generated (http://www.ssa.gov/employer/highgroup.txt). Old expression was: (^|\s)\d{3}(-?|[\. ])\d{2}\2\d{4}($|\s|[;:,!\.\?]). Looks for either the beginning of a line or whitespace before the beginning of the social security number, then either zero or one hyphen OR one of a period or space, then uses the \3 to reference the value returned in the parenthesis that includes the -?|[\. ] (basically says if the first dash, period, or space is there, then the second one is required; and if the first dash, period, or space is not there, then the second one can't be either), and finally looks for the end of a line, whitespace, or punctuation characters after the social security number. |
Matches |
123-45-6789 | 123 45 6789 | 123456789 |
Non-Matches |
12345-67-890123 | 1234-56-7890 | 123-45-78901 |
Author |
Rating:
Dennis Flynn
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?=((0[1-9]0)|([1-7][1-7]\d)|(00[1-9])|(0[1-9][1-9]))-(?=(([1-9]0)|(0[1-9])|([1-9][1-9]))-(?=((\d{3}[1-9])$|([1-9]\d{3})$|(\d[1-9]\d{2})$|(\d{2}[1-9]\d)$)))) |
Description |
I wrote this regular expression because a project I was working on required a stricter validator on social security numbers. There are actually gov't standards on what is a valid social: The first 3 digits can't be > 779, The first 3 digits can't be 000, The second 2 digits can't be 00, and the last 4 digits can't be 0000. This regex handles all these cases and checks formatting for numbering and dashes (###-##-####) |
Matches |
053-27-0293 | 770-29-2012 | 063-71-9123 |
Non-Matches |
780-20-1230 | 000-24-1290 | 123-00-1239 |
Author |
Rating:
Not yet rated.
Scott Long
|
Title |
Test
Details
Social Security Number
|
Expression |
^(?!000)([0-6]\d{2}|7([0-6]\d|7[012]))([ -]?)(?!00)\d\d\3(?!0000)\d{4}$ |
Description |
This regex validates U.S. social security numbers, within the range of numbers that have been currently allocated. |
Matches |
078-05-1120 | 078 05 1120 | 078051120 |
Non-Matches |
987-65-4320 | 000-00-0000 | (555) 555-5555 |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?!000)(?!666)(?<SSN3>[0-6]\d{2}|7(?:[0-6]\d|7[012]))([- ]?)(?!00)(?<SSN2>\d\d)\1(?!0000)(?<SSN4>\d{4})$ |
Description |
Updated on 3/4/2004 per feedback to additionally exclude SSNs that begin with 666 which, as reported, are also not valid.
Regular expression for validating US Social Security Numbers. Accepts optional hyphens or spaces as formatting characters. Parses the three subfields of the SSN into three named sub-strings (SSN1, SSN2, and SSN3) to facilitate program use. Rejects matches on all zeros for any individual subfield of the Social Security Number. Matches only on those SSNs that fall within the range of numbers currently allocated by the Social Security Administration. |
Matches |
111223333 | 111-22-3333 | 111 22 3333 |
Non-Matches |
111003333 | 111 22-3333 | 666-22-3333 |
Author |
Rating:
Not yet rated.
Jerry Schmersahl
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?!000)([0-6]\d{2}|7([0-6]\d|7[012])) ([ -])? (?!00)\d\d([ -|])? (?!0000)\d{4}$ |
Description |
U.S. social security numbers (SSN), within the range of numbers that have been currently allocated. Matches the pattern AAA-GG-SSSS, AAA GG SSSS, AAA-GG SSSS, AAA GG-SSSS, AAAGGSSSS, AAA-GGSSSS, AAAGG-SSSS, AAAGG SSSS or AAA GGSSSS. All zero in any one field is not allowed.
** Additionally, spaces and/or dashes and/or nothing are allowed. In Michael Ash's example 123-45 6789 and 123456789 would fail there was a '\3' after the second octet of numbers that seemed to confuse the regex. now any combination of spaces, dashes, or nothing will work between the SSN octets. BoxerX.com thanks Michael for the regex! |
Matches |
145470191 | 145 47 0191 | 145-47 0191 |
Non-Matches |
000470191 | 145-00-0191 | 145.47.0191 |
Author |
Rating:
Joe Johnston
|
Title |
Test
Details
Pattern Title
|
Expression |
^((\d(\x20)\d{2}(\x20)\d{2}(\x20)\d{2}(\x20)\d{3}(\x20)\d{3}((\x20)\d{2}|))|(\d\d{2}\d{2}\d{2}\d{3}\d{3}(\d{2}|)))$ |
Description |
It is an expression to valide a french numéro de sécurité social (social security number translate is not sure) with or without the key. |
Matches |
181049520156962 | 1 81 04 95 201 569 62 | 1 81 04 95 201 569 |
Non-Matches |
1 81049520156962 | 181049520156962fds | 1810495201569ds |
Author |
Rating:
Not yet rated.
krest krest
|
Title |
Test
Details
Danish CPRNR
|
Expression |
^((((0[1-9]|[12][0-9]|3[01])(0[13578]|10|12)(\d{2}))|(([0][1-9]|[12][0-9]|30)(0[469]|11)(\d{2}))|((0[1-9]|1[0-9]|2[0-8])(02)(\d{2}))|((29)(02)(00))|((29)(02)([2468][048]))|((29)(02)([13579][26])))[-]\d{4})$ |
Description |
Danish social security. [ddMMyy-0000]. Validates a correct date, but does not enforce the modulus 11 check (see www.cpr.dk for more information). |
Matches |
241283-1234|290204-1234 |
Non-Matches |
290206-1234 |
Author |
Rating:
Søren Møller Thomsen
|
Title |
Test
Details
Panamanian Government ID (Cedula)
|
Expression |
^(?<prov>10)(?<tipo>(AV))?-(?<tomo>\d{1,4})-(?<folio>\d{1,5})|^(?<prov>[1-9])(?<tipo>(AV))?-(?<tomo>\d{1,4})-(?<folio>\d{1,5})|^(?<tipo>(E|N|PE))-(?<tomo>\d{1,4})-(?<folio>\d{1,5}) |
Description |
The Panamanian "cedula" is the equivalent of the USA's Social Security Number or the Dutch SOFI number. It is composed of three groups. The 2nd and 3rd groups are digits only. The first group typically has a number between 1-10 only. But in some cases it has N (naturalized) or E (foreigner) or PE (panamanian born abroad). And in some ocassions a number followed by AV meaning the person was born before the "cedula" system came into existence..
Shortcomings of this long regex are: a)any character beyond the 3rd group is not flagged as a non-match |
Matches |
PE-233-782, N-233-782, E-233-875, 10AV-4568-12234, 8AV-1234-78456, 4-233-782, 10-233-782 |
Non-Matches |
8N-123-456 |
Author |
Rating:
Not yet rated.
Didimo Grimaldo
|
Title |
Test
Details
Medicare ID#
|
Expression |
^((\d){3})(-)?(\d){2}(-)?(\d){4}(A|B[1-7]?|M|T|C[1-4]|D)$ |
Description |
An individual's (soon to be) Medicare number in the USA is a social security number (whether it be the individual's, spouse's, or parent) plus a series of 1 or 2 digit characters at the end. |
Matches |
315-77-8771A 002-51-3788B2 |
Non-Matches |
215-77-8866 002-18-3399E |
Author |
Rating:
Not yet rated.
Mickael Caruso
|
Title |
Test
Details
Social Security Number
|
Expression |
^(?!000)(?!666)(?!9)\d{3}([- ]?)(?!00)\d{2}\1(?!0000)\d{4}$ |
Description |
Updated SSN regex. A very simple one for verifying a properly formatted US social security number. First three digits must be 001 - 899 and not 666. Disallows all zeros in a group. |
Matches |
123-45-6789 |
Non-Matches |
123-45 6789 | 1234-56-7890 | 123-00-7890 |
Author |
Rating:
tedcambron
|
Title |
Test
Details
Social Security Number
|
Expression |
^(\d{3}-\d{2}-\d{4})|(\d{3}\d{2}\d{4})$ |
Description |
This will accept SSN in the form of 123-45-6789 OR 123456789. |
Matches |
123-45-6789 | 123456789 | 456-63-6666 |
Non-Matches |
123-45-459a | 222-2-2222 | 222-222222 |
Author |
Rating:
Epaphrodite Dusingizimana
|
Title |
Test
Details
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:
John Stoker
|
Title |
Test
Details
Social Security Number - All Rules Enforced
|
Expression |
^((?!000)(?!666)(?:[0-6]\d{2}|7[0-2][0-9]|73[0-3]|7[5-6][0-9]|77[0-2]))-((?!00)\d{2})-((?!0000)\d{4})$ |
Description |
Could not find a regex that truly matched the rules here http://en.wikipedia.org/wiki/Social_Security_number#Valid_SSNs So I modified an existing one to match the valid SSN rules.
The first digit set will not match:
000, 666, 734 to 749, and greater than 772.
* Numbers with all zeros in any digit group (000-xx-####, ###-00-####, ###-xx-0000) |
Matches |
455-55-4444|333-22-1111|733-11-1111 |
Non-Matches |
734-11-1111|749-11-1111|772-11-1111 |
Author |
Rating:
Tim Cartwright
|
Title |
Test
Details
SSN (US Social Security Number)
|
Expression |
(?!000)(?!666)^([0-8]\d{2})(\d{2})(\d{4})$ |
Description |
Validates SSN for INTEGERS ONLY. This does not allow spaces or dashes.
Following this info:
http://www.socialsecurity.gov/employer/randomization.html
Starting in June 2011, the SSA will begin randomizing SSN creation. The only exclusions are SSNs beginning with 000, 666, or 900-999. That rather simplifies things. |
Matches |
001191873 | 667191873 | 899191873 |
Non-Matches |
000191873 | 666191873 | 901191873 |
Author |
Rating:
Not yet rated.
Robert Helm
|
Title |
Test
Details
Swedish social security number (Svenskt personnummer)
|
Expression |
\b(((20)((0[0-9])|(1[0-1])))|(([1][^0-8])?\d{2}))((0[1-9])|1[0-2])((0[1-9])|(2[0-9])|(3[01]))[-+]?\d{4}[,.]?\b |
Description |
Matches a Swedish social security number in format xxYYMMDD-NNNN, xxYYMMDD+NNNN, YYMMDD-NNNN, YYMMDD-NNNN and YYMMDDNNN. Does not allow birth years before 1900 and after 2011.
To raise the birth year to higher level of birth just change the 1[0-1] part to i.e. 1[0-4] to allow birth years up to 2014 etc.
This will find the SSN within a string. Also allow for a comma(,) or period(.) behind the SSN. |
Matches |
7712314582 | 810325+0782 | 19771231-4582 |
Non-Matches |
137712314582 | 201211224567 | 10880215-0987 |
Author |
Rating:
Not yet rated.
Emil
|
Title |
Test
Details
Swedish social security number (Svenskt personnummer)
|
Expression |
^(((20)((0[0-9])|(1[0-1])))|(([1][^0-8])?\d{2}))((0[1-9])|1[0-2])((0[1-9])|(2[0-9])|(3[01]))[-]?\d{4}$ |
Description |
Matches a Swedish social security number in format CCYYMMDD-NNNN, CCYYMMDDNNNN, YYMMDD-NNNN and YYMMDDNNNN on a single line. More useful version of my earlier expression. Will only match 1900 - 2011 years. |
Matches |
7712314582 | 810325-0782 | 19771231-4582 | 197712314582 |
Non-Matches |
137712314582 | 201211224567 | 10880215-0987 |
Author |
Rating:
Not yet rated.
Emil
|
Title |
Test
Details
ssn randomization rule
|
Expression |
^(?!000)(?!666)([0-8]\d{2}) ([ -])? (?!00)\d\d ([ -])? (?!0000)\d{4}$ |
Description |
Current SSN randomization rules, also caled Social Security Number Randomization, effective since June 25, 2011. Validates 9 digit numbers, not separated or separated by - or space, not starting with 000, 666, or 900-999, not containing 00 or 0000 in the middle or at the end of SSN. |
Matches |
899-04 1234 | 001 99-8000 | 667999999 |
Non-Matches |
900123456 | 000349850 | 324001234 | 765870000 | 900-12-1234 |
Author |
Rating:
Not yet rated.
Bryan Zayas
|
Title |
Test
Details
Social Security Number (SSN) issued after 6/25/2011
|
Expression |
^(?!000)(?!666)(?!9)\d{3}[- ]?(?!00)\d{2}[- ]?(?!0000)\d{4}$ |
Description |
I am publishing this regex that was written by Stephen M. Redd and taken from the following URL: http://www.reddnet.net/regular-expression-for-validating-a-social-security-number-ssn-issued-after-june-25-2011/. It allows a dash or space separator and accounts for the new numbers that were previously restricted prior to June 25, 2011. |
Matches |
123456789 | 123-45-6789 | 123 45 6789 |
Non-Matches |
000456789 | 000-45-6789 | 000 45 6789 |
Author |
Rating:
Not yet rated.
Joseph Marinello
|
Displaying page
of
pages;
Items to