MetadataSearchRedaction
Leave feedback
On this page
Represents a metadata redaction that searches and redacts metadata using regular expressions, matching keys and/or values.
public class MetadataSearchRedaction : MetadataRedaction
| Name | Description |
|---|---|
| MetadataSearchRedaction(Regex, string) | Initializes a new instance of MetadataSearchRedaction class, using value to match redacted items. |
| MetadataSearchRedaction(string, string) | Initializes a new instance of MetadataSearchRedaction class, using value to match redacted items. |
| MetadataSearchRedaction(Regex, string, Regex) | Initializes a new instance of MetadataSearchRedaction class, using item name and value to match redacted items. |
| MetadataSearchRedaction(string, string, string) | Initializes a new instance of MetadataSearchRedaction class, using item name and value to match redacted items. |
| Name | Description |
|---|---|
| override Description { get; } | Returns a string, describing the redaction and its parameters. |
| Filter { get; set; } | Gets or sets the filter, which is used to select all or specific metadata, for example Author or Company. |
| KeyExpression { get; } | Gets the regular expression to match name (key) of metadata item. |
| Replacement { get; } | Gets the textual replacement value. |
| ValueExpression { get; } | Gets the regular expression to match value text of a metadata item. |
| Name | Description |
|---|---|
| override ApplyTo(DocumentFormatInstance) | Applies the redaction to a given format instance. |
Learn more
- More details about applying redactions: Redaction basics
- More details about document metadata redactions: Metadata redactions
The following example demonstrates how to search and redact certain text in specific metadata.
using (Redactor redactor = new Redactor(@"C:\sample.docx"))
{
MetadataSearchRedaction redaction = new MetadataSearchRedaction("Company Ltd.", "--company--");
// If not set, applies to all metadata items
redaction.Filter = MetadataFilters.Company;
redactor.Apply(redaction);
redactor.Save();
}
- class MetadataRedaction
- namespace GroupDocs.Redaction.Redactions
- assembly GroupDocs.Redaction
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.