bin/datamasking/pii-patterns.json

[
    {
        "Name": "Bitcoin Address",
        "Category": "Financial",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "(?<![a-km-zA-HJ-NP-Z0-9])[13][a-km-zA-HJ-NP-Z0-9]{26,33}(?![a-km-zA-HJ-NP-Z0-9])"
    },
    {
        "Name": "Creditcard General",
        "Category": "Financial",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "(\\d{4}([\\D]?\\d{4}){3}([\\D]?\\d{3})?|\\d{4}[\\D]?\\d{6}[\\D]?\\d{5}([\\D]?\\d{4})?)[^A-Za-z0-9]"
    },
    {
        "Name": "Creditcard AMEX",
        "Category": "Financial",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "(3[47]\\d{13})|(3[47]\\d{2}[-| ]\\d{6}[-| ]\\d{5})"
    },
    {
        "Name": "Creditcard Mastercard",
        "Category": "Financial",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "(5[1-5]\\d{14})|(5[1-5]\\d{2}[-| ]\\d{4}[-| ]\\d{4}[-| ]\\d{4})"
    },
    {
        "Name": "Creditcard VISA",
        "Category": "Financial",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "(4\\d{3}[-| ]\\d{4}[-| ]\\d{4}[-| ]\\d{4})|(4\\d{15})"
    },
    {
        "Name": "Creditcard Diners Club",
        "Category": "Financial",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "(3(?:0[0-5]|[68]\\d)\\d{11})|(3(?:0[0-5]|[68]\\d)\\d[-| ]\\d{6}[-| ]\\d{4})"
    },
    {
        "Name": "Creditcard Discover",
        "Category": "Financial",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "(6(?:011|5\\d{2})\\d{12})|(6(?:011|5\\d{2})[-| ]\\d{4}[-| ]\\d{4}[-| ]\\d{4})"
    },
    {
        "Name": "Creditcard JCB",
        "Category": "Financial",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "((?:2131|1800|35\\d{3})\\d{11})|((?:2131|1800|35\\d{2})[-| ]\\d{4}[-| ]\\d{4}[-| ]\\d{3}[\\d| ])"
    },
    {
        "Name": "E-mail",
        "Category": "Communication",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "^[\\w\\.=-]+@[\\w\\.-]+\\.[\\w]{2,3}$"
    },
    {
        "Name": "IBAN Number",
        "Category": "Financial",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "[A-Z]{2}?[ ]?[0-9]{2}[]?[0-9]{4}[ ]?[0-9]{4}[ ]?[0-9]{4}[ ]?[0-9]{4}[ ]?[0-9]{4}"
    },
    {
        "Name": "IPv4 Address",
        "Category": "Internet",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "^\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}$"
    },
    {
        "Name": "IPv6 Address",
        "Category": "Internet",
        "Country": "All",
        "CountryCode": "All",
        "Pattern": "\\s*(?!.*::.*::)(?:(?!:)|:(?=:))(?:[0-9a-f]{0,4}(?:(?<=::)|(?<!::):)){6}(?:[0-9a-f]{0,4}(?:(?<=::)|(?<!::):)[0-9a-f]{0,4}(?:(?<=::)|(?<!:)|(?<=:)(?<!::):)|(?:25[0-4]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-4]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})\\s*"
    },
    {
        "Name": "National Identification Number",
        "Category": "Personal",
        "Country": "Austria",
        "CountryCode": "AT",
        "Pattern": "[0-9]{12}"
    },
    {
        "Name": "Street Address",
        "Category": "Location",
        "Country": "United States of America",
        "CountryCode": "US",
        "Pattern": "\\d{1,4} [\\w\\s]{1,20}(?:street|st|avenue|ave|road|rd|highway|hwy|square|sq|trail|trl|drive|dr|court|ct|parkway|pkwy|circle|cir|boulevard|blvd)\\W?(?=\\s|$)"
    },
    {
        "Name": "Social Security Number",
        "Category": "Personal",
        "Country": "Austria",
        "CountryCode": "AT",
        "Pattern": "^[0-9]{10}$"
    },
    {
        "Name": "Social Security Number",
        "Category": "Personal",
        "Country": "Belgium",
        "CountryCode": "BE",
        "Pattern": "[0-9]{2}\\.?(0[1-9]|1[0-2])\\.?(0[1-9]|1[0-9]|2[0-9]|3[0-1])-[0-9]{3}\\.?[0-9]{2}"
    },
    {
        "Name": "Social Security Number",
        "Category": "Personal",
        "Country": "Bulgaria",
        "CountryCode": "Bg",
        "Pattern": "[0-9]{2}\\.?[0-9]{2}\\.?[0-9]{2}-[0-9]{3}\\.?[0-9]{2}"
    },
    {
        "Name": "Burgerservicenummer",
        "Category": "Personal",
        "Country": "Netherlands",
        "CountryCode": "NL",
        "Pattern": "^[0-9]{9}$"
    },
    {
        "Name": "Social Security Number",
        "Category": "Personal",
        "Country": "United States of America",
        "CountryCode": "US",
        "Pattern": "\\b(?!000|666|9\\d{2})([0-8]\\d{2}|7([0-6]\\d))([-]?|\\s{1})(?!00)\\d\\d\\2(?!0000)\\d{4}\b"
    },
    {
        "Name": "Zipcode",
        "Category": "Location",
        "Country": "Netherlands",
        "CountryCode": "NL",
        "Pattern": "^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[A-Za-z]{2}$"
    },
    {
        "Name": "Zipcode",
        "Category": "Location",
        "Country": "United States of America",
        "CountryCode": "US",
        "Pattern": "^((\\d{5}-\\d{4})|(\\d{5})|([A-Z]\\d[A-Z]\\s\\d[A-Z]\\d))$"
    },
    {
        "Name": "Mobile Phone Number",
        "Category": "Communication",
        "Country": "Netherlands",
        "CountryCode": "NL",
        "Pattern": "^0[6]{1}(\\-)?[^0\\D]{1}\\d{7}$"
    },
    {
        "Name": "Birth Number",
        "Category": "Personal",
        "Country": "Slovakia",
        "CountryCode": "SK",
        "Pattern": "[0-9]{2}[0,1,5][0-9][0-9]{2}/?[0-9]{4}"
    },
    {
        "Name": "Citizen Identification Card Number",
        "Category": "Personal",
        "Country": "Slovakia",
        "CountryCode": "SK",
        "Pattern": "[A-Z]{2}[0-9]{6}"
    },
    {
        "Name": "CPR Number",
        "Category": "Personal",
        "Country": "Denmark",
        "CountryCode": "DK",
        "Pattern": "[0-9]{2}[0,1][0-9][0-9]{2}-[0-9]{4}"
    },
    {
        "Name": "Personal code Estonia",
        "Category": "Personal",
        "Country": "Estonia",
        "CountryCode": "EE",
        "Pattern": "[1-6][0-9]{2}[1,2][0-9][0-9]{2}[0-9]{4}"
    },
    {
        "Name": "Personal identity code",
        "Category": "Personal",
        "Country": "Finland",
        "CountryCode": "FI",
        "Pattern": "[0-9]{2}\\.?[0,1][0-9]\\.?[0-9]{2}[-+A][0-9]{3}[A-Z]"
    },
    {
        "Name": "Social Security Number",
        "Category": "Personal",
        "Country": "France",
        "CountryCode": "FR",
        "Pattern": "1,2][ ]?[0-9]{2}[]?[0,1,2,3,5][0-9][ ]?[0-9A-Z]{5}[ ]?[0-9]{3}[ ]?[0-9]{2}"
    },
    {
        "Name": "Personenkennziffer",
        "Category": "Personal",
        "Country": "Germany",
        "CountryCode": "DE",
        "Pattern": "[0-9]{2}[0,1][0-9][0-9]{2}-[A-Z]-[0-9]{5}"
    },
    {
        "Name": "Steuer-Identifikationsnummer",
        "Category": "Personal",
        "Country": "Germany",
        "CountryCode": "DE",
        "Pattern": "[0-9]{3}/?[0-9]{4}/?[0-9]{4}"
    },
    {
        "Name": "Versicherungsnummer,Rentenversicherungsnummer",
        "Category": "Personal",
        "Country": "Germany",
        "CountryCode": "DE",
        "Pattern": "[0-9]{2}[0-9]{2}[0,1][0-9][0-9]{2}[A-Z][0-9]{2}[0-9]"
    },
    {
        "Name": "Tautotita",
        "Category": "Personal",
        "Country": "Greece",
        "CountryCode": "GR",
        "Pattern": "[A-Z][ -]?[0-9]{6}"
    },
    {
        "Name": "Social insurance number",
        "Category": "Personal",
        "Country": "Hungary",
        "CountryCode": "HU",
        "Pattern": "[0-9]{3}[ ]?[0-9]{3}[ ][0-9]{3}"
    },
    {
        "Name": "Personal identfication number",
        "Category": "Personal",
        "Country": "Hungary",
        "CountryCode": "HU",
        "Pattern": "[1-8][ ]?[0-9]{2}[0,1][0-9][0-9]{2}[ ]?[0-9]{4}"
    },
    {
        "Name": "Personal Public Service Number",
        "Category": "Personal",
        "Country": "Ireland",
        "CountryCode": "IE",
        "Pattern": "[0-9]{7}[A-Z]W?"
    },
    {
        "Name": "Codice fiscale",
        "Category": "Personal",
        "Country": "Italy",
        "CountryCode": "IT",
        "Pattern": "[A-Z]{6}[0-9]{2}[A-E,H,L,M,P,R-T][0-9]{2}[A-Z0-9]{5}"
    },
    {
        "Name": "Personal no (Personas kodas)",
        "Category": "Personal",
        "Country": "Latvia",
        "CountryCode": "LV",
        "Pattern": "[0-9]{2}[0,1][0-9][0-9]-[0-9]{5}"
    },
    {
        "Name": "Personal code (Asmens kodas)",
        "Category": "Personal",
        "Country": "Lithuania",
        "CountryCode": "LT",
        "Pattern": "[3-6][0-9]{2}[0,1][0-9][0-9]{2}[0-9]{4}"
    },
    {
        "Name": "Fødselsnummer",
        "Category": "Personal",
        "Country": "Norway",
        "CountryCode": "NO",
        "Pattern": "[0-9]{2}[0,1][0-9][0-9]{2}[ ]?[0-9]{5}"
    },
    {
        "Name": "National identification number",
        "Category": "Personal",
        "Country": "Poland",
        "CountryCode": "PL",
        "Pattern": "[0-9]{4}[0-3]{1}[0-9}{1}[0-9]{5}"
    },
    {
        "Name": "National identification number",
        "Category": "Personal",
        "Country": "Romania",
        "CountryCode": "RO",
        "Pattern": "[1-8][0-9]{2}[0,1][0-9][0-9]{2}[0-9]{6}"
    },
    {
        "Name": "Documento Nacional de Identidad",
        "Category": "Personal",
        "Country": "Spain",
        "CountryCode": "ES",
        "Pattern": "[0-9,X,M,L,K,Y][0-9]{7}[A-Z]"
    },
    {
        "Name": "National identification number",
        "Category": "Personal",
        "Country": "Sweden",
        "CountryCode": "SE",
        "Pattern": "[0-9]{2}[0-1][0-9][0-9]{2}[-+][0-9]{4}"
    },
    {
        "Name": "Old AVS format with personal data encoded",
        "Category": "Personal",
        "Country": "Switzerland",
        "CountryCode": "CH",
        "Pattern": "[0-9]{3}\\.?[0-9]{2}\\.?[0-9]{3}\\.?[0-9]{3}"
    },
    {
        "Name": "New AVS format",
        "Category": "Personal",
        "Country": "Switzerland",
        "CountryCode": "CH",
        "Pattern": "756\\.?[0-9]{4}\\.?[0-9]{4}\\.?[0-9]{2}"
    },
    {
        "Name": "National identification number",
        "Category": "Personal",
        "Country": "United Kingdom",
        "CountryCode": "UK",
        "Pattern": "[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z]{1}[0-9]{6}[A-DFM]?"
    },
    {
        "Name": "National insurance number",
        "Category": "Personal",
        "Country": "United Kingdom",
        "CountryCode": "UK",
        "Pattern": "^([ACEHJLMOPRSW-Yacehjlmoprsw-y][A-CEGHJ-NPRSTW-Za-ceghj-nprstw-z]|[Bb][A-CEHJ-NPRSTW-Za-cehj-nprstw-z]|[Gg][ACEGHJ-NPRSTW-Zaceghj-nprstw-z]|[Kk][A-CEGHJ-MPRSTW-Za-ceghj-mprstw-z]|[Nn][A-CEGHJLMNPRSW-Za-ceghjlmnprsw-z]|[Tt][A-CEGHJ-MPRSTW-Za-ceghj-mprstw-z]|[Zz][A-CEGHJ-NPRSTW-Ya-ceghj-nprstw-y])[0-9]{6}[A-Da-d ]?$"
    },
    {
        "Name": "UK NHS Number",
        "Category": "Personal",
        "Country": "United Kingdom",
        "CountryCode": "UK",
        "Pattern": "[0-9]{3}[ -]?[0-9]{3}[-]?[0-9]{4}"
    }
]