GDPR Filters
Let's examine some example messages that a user might send:
// User is sending an IBAN
John Doe, TR320010009999901234567890 is my IBAN.
// After masking:
John Doe, ** is my IBAN.
// User is sending a T.C. number
My ID number is 10928416630.
// After masking:
My ID number is **.
// User is sending both a Turkish ID number and a phone number
My ID is 10928416630, and my phone is +905455455454.
// After masking:
My ID is **, and my phone is **.**Please note that the examples given above are all used as an example, they typed randomly
We can mask such personal information by adding regex patterns.
If you want to add a new regex pattern, other than IBAN and email:
In the example above, we provided a regex pattern for masking Turkish phone numbers. Be aware that users may send variations of messages, and you may need to add additional regex patterns or improve your existing ones to handle such cases.
Here are a few example regex patterns:
// Credit card
([0-9]{4})\\\\s?([0-9]{4})\\\\s?([0-9]{4})\\\\s?([0-9]{4})
// Turkish ID number
[1-9]{1}[0-9]{9}[02468]{1}
// Visa credit card
4[0-9]{12}(?:[0-9]{3})?
// American Express
3[47][0-9]{13}
//TR IBAN
\bTR\d{2}\s\d{4}\s\d{4}\s\d{4}\s\d{4}\s\d{4}\s\d{2}\b
//Saudi Arabian
\bSA\d{2}\s*\d{4}\s*\d{4}\s*\d{4}\s*\d{4}\s*\d{0,18}\b
//German
\bDE\d{2}\s*\d{4}\s*\d{4}\s*\d{4}\s*\d{4}\s*\d{4}\s*\d{0,2}\b