Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Java 8

"
.*\b((?:(?!666|000)[0-8][0-9_]{2}[.-]?(?!00)[0-9_]{2}[.-]?(?!0000)[0-9_]{4}|[0-9]{9}))\b.*
"
gm

Description

If for whatever reason there isn't a delimiter within your data to for storing your SSNs you should be able to use this regular expression to capture 9 digit strings within data. You might need to add special keywords to filter out false positives.

Submitted by loganmcampbell - 3 years ago