personally identifiable information regex

This commit is contained in:
unix23 2011-03-03 06:22:28 +00:00
parent 96dcabe5b4
commit 9e9135cb31
2 changed files with 71 additions and 0 deletions

18
regex/pii.fuzz.txt Normal file
View file

@ -0,0 +1,18 @@
\b(1800|2131|30[0-5]\d|3[4-7]\d{2}|4\d{3}|5[0-5]\d{2}|6011|6[2357]\d{2})[- ]?(\d{4}[- ]?\d{4}[- ]?\d{4}|\d{6}[- ]?\d{5})\b
\b\d{4}(0[1-9]|[12]\d|3[01])(0[1-9]|1[0-5])\d{2}\b
\b\d{2}([024][1-9]|[135][0-2])(0[1-9]|[12]\d|3[01])[-+]?\d{4}\b
\b[1-9]\d{2}[- ]?\d{3}[- ]?\d{3}\b
\b\d{6}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{4}\b
\b(0[1-9]|[12]\d|3[01])(0[1-9]|1[0-2])(9\d{2}|0[01]\d)\d{6}\b
\b(0[1-9]|[12]\d|3[01])(0[1-9]|1[0-2])\d{2}[-+]?\d{4}\b
\b(0[1-9]|[12]\d|3[01])(0[1-9]|1[0-2])\d{2}[-+a]\d{3}\w\b
\b[a-z]{3}[abcfghjlpt][a-z]\d{4}[a-z]\b
\b([a-z]{2}[ ]\d{1,2}|dl[ ][1-9]?\d[ ][cprstvy])[ ][a-z]{0,2}[ ]\d{1,4}\b
\b([bcdfghj-np-tv-z][a-z]{2}){2}\d{2}[a-ehlmprst]([04][1-9]|[1256]\d|[37][01])(\d[a-z]{3}|z\d{3})[a-z]\b
\b(0[1-9]|[12]\d|3[01])([04][1-9]|[15][0-2])\d{7}\b
\b[1-8]\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])(0[1-9]|[1-4]\d|5[0-2]|99)\d{4}\b
\b\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\-[0-49]\d{6}\b
\b(19\d{2}|20\d{2}|\d{2})(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])[-+]?\d{4}\b
\b[a-z][12]\d{8}\b
\b[abceghj-prstw-z][abceghj-nprstw-z][ ]?\d{2}[ ]?\d{2}[ ]?\d{2}[ ]?[a-dfm]?\b
\b(?!000)(?!666)([0-6]\d{2}|7([0-356]\d|7[012]))[- ]?(?!00)\d{2}[- ]?(?!0000)\d{4}\b

53
regex/pii.readme.txt Normal file
View file

@ -0,0 +1,53 @@
Almost\ all\ major\ credit\ cards\ \(and\ most\ debit\ cards\)\ \(example\=4111\ 1111\ 1111\ 1111\):\
\\b\(1800\|2131\|30\[0-5\]\\d\|3\[4-7\]\\d{2}\|4\\d{3}\|5\[0-5\]\\d{2}\|6011\|6\[2357\]\\d{2}\)\[-\ \]\?\(\\d{4}\[-\ \]\?\\d{4}\[-\ \]\?\\d{4}\|\\d{6}\[-\ \]\?\\d{5}\)\\b\
\
Austrian\ Social\ Security\ Number\ \(de\=Sozialversicherungsnummer\)\ \(example\=1788011550\):\
\\b\\d{4}\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\(0\[1-9\]\|1\[0-5\]\)\\d{2}\\b\
\
Bulgarian\ Uniform\ Civil\ Number\ \(bg\=Единен\ граждански\ номер\)\ \(example:7523169263\):\
\\b\\d{2}\(\[024\]\[1-9\]\|\[135\]\[0-2\]\)\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\[-+\]\?\\d{4}\\b\
\
Canadian\ Social\ Insurance\ Number:\
\\b\[1-9\]\\d{2}\[-\ \]\?\\d{3}\[-\ \]\?\\d{3}\\b\
\
Chinese\ National\ Identification\ Card\ Number\ \(cn\=身份证\):\
\\b\\d{6}\(19\|20\)\\d{2}\(0\[1-9\]\|1\[0-2\]\)\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\\d{4}\\b\
\
Croatian\ Master\ Citizen\ Number\ \(hr\=Matični\ broj\ građana\):\
\\b\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\(0\[1-9\]\|1\[0-2\]\)\(9\\d{2}\|0\[01\]\\d\)\\d{6}\\b\
\
Danish\ Civil\ Registration\ Number\ \(dk\=Personnummer,\ CPR\ Nummer\):\
\\b\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\(0\[1-9\]\|1\[0-2\]\)\\d{2}\[-+\]\?\\d{4}\\b\
\
Finnish\ Social\ Security\ Number\ \(fi\=Henkilötunnus\)\ \(example\=311280-999J\):\
\\b\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\(0\[1-9\]\|1\[0-2\]\)\\d{2}\[-+a\]\\d{3}\\w\\b\
\
Indian\ Permanent\ Account\ Number:\
\\b\[a-z\]{3}\[abcfghjlpt\]\[a-z\]\\d{4}\[a-z\]\\b\
\
Indian\ Vehicle\ License\ Plate\ Number\ \(example\=DL\ 11\ C\ AA\ 1111\):\
\\b\(\[a-z\]{2}\[\ \]\\d{1,2}\|dl\[\ \]\[1-9\]\?\\d\[\ \]\[cprstvy\]\)\[\ \]\[a-z\]{0,2}\[\ \]\\d{1,4}\\b\
\
Italian\ Fiscal\ Code\ \(it\=Codice\ fiscale\)\ \(example\=HDDFTH63H28Z352V\):\
\\b\(\[bcdfghj-np-tv-z\]\[a-z\]{2}\){2}\\d{2}\[a-ehlmprst\]\(\[04\]\[1-9\]\|\[1256\]\\d\|\[37\]\[01\]\)\(\\d\[a-z\]{3}\|z\\d{3}\)\[a-z\]\\b\
\
Norwegian\ Social\ Security\ Number\ \(no\=Personnummer,\ Fødselsnummer,\ SSNR\):\
\\b\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\(\[04\]\[1-9\]\|\[15\]\[0-2\]\)\\d{7}\\b\
\
Romanian\ Personal\ Numeric\ Code\ \(ro\=Cod\ Numeric\ Personal\)\ \(example\=1800101221144\):\
\\b\[1-8\]\\d{2}\(0\[1-9\]\|1\[0-2\]\)\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\(0\[1-9\]\|\[1-4\]\\d\|5\[0-2\]\|99\)\\d{4}\\b\
\
South\ Korean\ Resident\ Registration\ Number\ \(ko\=주민등록번호\):\
\\b\\d{2}\(0\[1-9\]\|1\[0-2\]\)\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\\-\[0-49\]\\d{6}\\b\
\
Swedish\ Personal\ Identification\ Number\ \(se\=Personnummer\):\
\\b\(19\\d{2}\|20\\d{2}\|\\d{2}\)\(0\[1-9\]\|1\[0-2\]\)\(0\[1-9\]\|\[12\]\\d\|3\[01\]\)\[-+\]\?\\d{4}\\b\
\
Taiwanese\ National\ Identification\ Card\ Number:\
\\b\[a-z\]\[12\]\\d{8}\\b\
\
United\ Kingdom\ National\ Insurance\ Number\ \(example\=AA\ 01\ 23\ 44\ B\):\
\\b\[abceghj-prstw-z\]\[abceghj-nprstw-z\]\[\ \]\?\\d{2}\[\ \]\?\\d{2}\[\ \]\?\\d{2}\[\ \]\?\[a-dfm\]\?\\b\
\
United\ States\ Social\ Security\ Number\ \(example\=078-05-1120\):\
\\b\(\?\!000\)\(\?\!666\)\(\[0-6\]\\d{2}\|7\(\[0-356\]\\d\|7\[012\]\)\)\[-\ \]\?\(\?\!00\)\\d{2}\[-\ \]\?\(\?\!0000\)\\d{4}\\b