Page 1 of 1

Redact names with PDFTools

Posted: Tue Jan 23, 2024 1:52 pm
by basbeek
Hello,

At the moment I am trying to use the "search and redact" option in PDFTools. I need to add a pattern with which I can redact multiple files at once (batch-modus). I don't know how to create this pattern. Can anyone help?

In all files, there is structure like this:

Lastname, Surname (Organisation)
surname.lastname@organisation.nl

I want to redact it like this:
Lastname, Surname (Organisation) --> Only keep (Organisation) visibile
surname.lastname@organisation.nl --> only keep @organisation.nl visible

EDIT: for surname.lastname@organisation.nl, this worked: \b([A-Za-z0-9._%+-]+)(?=@). Now I still need Lastname, Surname. I can't fix this in Regex.

Is it possible to make a pattern for this in regex?

Kinds regards,

Bas

Re: Redact names with PDFTools

Posted: Tue Jan 23, 2024 11:09 pm
by Roman - Tracker Supp
Hello basbeek,

Assuming the organization name has the same pattern as the last and first name (i.e. [A-Za-z0-9_%+-]+),
the regular expression for your first case can be:
\b[A-Za-z0-9_%+-]+\s*,\s*[A-Za-z0-9_%+-]+\s*(?=\([A-Za-z0-9_%+-]+\))

Re: Redact names with PDFTools

Posted: Wed Jan 24, 2024 3:09 pm
by basbeek
Thank you, this works!

Redact names with PDFTools

Posted: Wed Jan 24, 2024 3:36 pm
by Paul - PDF-XChange
:)