Removing confidential info from text

Hi all,
A form or an email returns text. How can I remove info like emails, names, phone numbers, address etc.? It’s not always structured, and I thought of using AI, but the idea is to NOT to use ChatGPT as much as possible. Like with the email, I could look for the @ sign, any 9 digit numbers or something similar, but can’t figure our a way of achieving this.

Emails, phone numbers is easy, because they have universal patterns.

Address is slightly more difficult if you want to make a pattern for it.

The tricky part which is almost impossible, is detecting names, since there is no pattern you can use. For this you’ll need either human or AI intervention, or have a pre-determined list of names that you can match against.

2 Likes