Regular Expressions 101

Community Library Entry

0

Regular Expression
Python

r"
^(?!\b(\d)\1+\b)(?!123456789|002281852|042103580|062360749|078051120|095073645|128036045|135016629|141186941|165167999|165187999|165207999|165227999|165247999|189092294|212097694|212099999|306302348|308125070|468288779|549241889)(?!000|666|9\d{2})\d{2}(?!00)\d{2}(?!0{4})\d{4}$
"

Description

Validate that the social security number follows all of the guidelines of the Social Security Administration, and excludes all voided numbers.

Submitted by Jacob O'Dea - 9 years ago