Regular expression to search and replace metadata item value.
replacement
str
Textual replacement.
key_pattern
str
Regular expression to search and replace metadata item name.
Example
fromgroupdocs.redactionimportRedactorfromgroupdocs.redaction.redactionsimportMetadataSearchRedactionwithRedactor("document.docx")asredactor:# Replace any email address found in metadata valuesredaction=MetadataSearchRedaction(r".*@acme\.com","[EMAIL]")redactor.apply(redaction)redactor.save()
init
Initializes a new instance of MetadataSearchRedaction class, using value to match redacted items.
def__init__(self,value_regex,replacement):...
Parameter
Type
Description
value_regex
System.Text.RegularExpressions.Regex
Regular expression to search and replace.
replacement
str
Textual replacement.
Example
fromgroupdocs.redactionimportRedactorfromgroupdocs.redaction.redactionsimportMetadataSearchRedaction# Redact any email address in metadataredaction=MetadataSearchRedaction(r".*@acme\.com","[EMAIL]")withRedactor("document.docx")asredactor:redactor.apply(redaction)redactor.save()
init
Initializes a new instance of MetadataSearchRedaction using item name and value to match redacted items.