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: https://docs.groupdocs.com/redaction/net/redaction-basics/
- More details about document text redactions: https://docs.groupdocs.com/redaction/net/text-redactions/
The ExactPhraseRedaction type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new instance of ExactPhraseRedaction in case‑insensitive mode. |
| init | Initializes a new ExactPhraseRedaction instance. |
| Method | Description |
|---|---|
| apply_to | Applies the redaction to a given format instance. |
| apply_to_document_format_instance |
| Property | Description |
|---|---|
| description | The description of the redaction, containing the redaction name and parameters. |
| is_case_sensitive | The value indicating 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 IOcrConnector 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 replacement
redactor.apply(ExactPhraseRedaction("John Doe", True, ReplacementOptions("[personal]")))
redactor.save()
Task guides that use ExactPhraseRedaction:
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.