ExactPhraseRedaction class
Leave feedback
On this page
Represents a text redaction that replaces an exact phrase in the document’s text, case insensitive by default.
Learn more
- More details about applying redactions: Redaction basics
- More details about document text redactions: Text redactions
The ExactPhraseRedaction type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new instance of ExactPhraseRedaction class in case insensitive mode. |
| init | Initializes a new ExactPhraseRedaction. |
| Method | Description |
|---|---|
| apply_to | Applies the redaction to a given format instance. |
| Property | Description |
|---|---|
| description | The description of the redaction, containing its name and parameters. |
| is_case_sensitive | The property indicates whether the search is case-sensitive. |
| is_right_to_left | The text direction flag indicating whether the text is right-to-left; defaults to False. |
| search_phrase | The string to search and replace. |
| action_options | The ReplacementOptions instance specifying the type of text replacement. (inherited from TextRedaction) |
| ocr_connector | The OCR connector implementation used to extract text from graphic content. (inherited from TextRedaction) |
from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import ExactPhraseRedaction, ReplacementOptions
with Redactor("sample.pdf") as redactor:
# Case-sensitive phrase replacement
redactor.apply(ExactPhraseRedaction("Emily Johnson", True, ReplacementOptions("[personal]")))
# Case-insensitive phrase replacement (default)
redactor.apply(ExactPhraseRedaction("Emily Johnson", ReplacementOptions("[personal]")))
redactor.save()
Task guides that use ExactPhraseRedaction:
- Hello, World!
- Quick Start Guide
- Redaction basics
- Text redaction
- Spreadsheet redactions
- Use redaction policies
- Use redaction callback
- OCR usage basics
- Use Tesseract OCR
- Load with file type
- Use advanced logging
- Save Word with OOXML compliance
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.