Redact names with PDFTools

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Post Reply
basbeek
User
Posts: 9
Joined: Tue Mar 16, 2021 1:17 pm

Redact names with PDFTools

Post 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
User avatar
Roman - Tracker Supp
Site Admin
Posts: 332
Joined: Sun Nov 21, 2004 3:19 pm

Re: Redact names with PDFTools

Post 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_%+-]+\))
basbeek
User
Posts: 9
Joined: Tue Mar 16, 2021 1:17 pm

Re: Redact names with PDFTools

Post by basbeek »

Thank you, this works!
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7358
Joined: Wed Mar 25, 2009 10:37 pm
Contact:

Redact names with PDFTools

Post by Paul - PDF-XChange »

:)
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Post Reply