// เปิดเอกสารที่คุณต้องการทำความสะอาด
final Redactor redactor = new Redactor("source.pptx");
try
{
// กำหนดรูปแบบ regex สำหรับ EMAIL และข้อความที่ใช้แทน
ReplacementOptions repl_opt = new ReplacementOptions("[redacted]");
String emailRegex = "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}";
RegexRedaction redaction = new RegexRedaction(emailRegex, repl_opt);
// จัดการลบตามกฎ
redactor.apply(redaction);
// บันทึกไฟล์ที่ถูกลบ
SaveOptions saveOptions = new SaveOptions();
saveOptions.setAddSuffix(true);
saveOptions.setRasterizeToPDF(false);
redactor.save(saveOptions);
}
finally { redactor.close(); }