Initializes a new AnnotationRedaction with a regex pattern and replacement text.
def__init__(self,pattern,replacement):...
Parameter
Type
Description
pattern
str
Regular expression to match.
replacement
str
Textual replacement for matched text.
Example
fromgroupdocs.redaction.redactionsimportAnnotationRedaction# Redact the word "approved" in annotation textsredaction=AnnotationRedaction(r"(?i)approved","[REVIEW]")
fromgroupdocs.redaction.redactionsimportAnnotationRedaction# Redact the word "approved" (case‑insensitive) and replace it with "[REVIEW]"redaction=AnnotationRedaction("(?i)approved","[REVIEW]")