RegexRedaction Class |
Namespace: GroupDocs.Redaction.Redactions
The RegexRedaction type exposes the following members.
Name | Description | |
---|---|---|
![]() | RegexRedaction(String, ReplacementOptions) |
Initializes a new instance of RegexRedaction class.
|
![]() | RegexRedaction(Regex, ReplacementOptions) |
Initializes a new instance of RegexRedaction class.
|
Name | Description | |
---|---|---|
![]() | ActionOptions |
Gets the ReplacementOptions instance, specifying type of text replacement.
(Inherited from TextRedaction.) |
![]() | Description |
Returns a string, describing the redaction and its parameters.
(Overrides RedactionDescription.) |
![]() | OcrConnector |
Gets or sets the IOcrConnector implementation, required to extract text from graphic content.
(Inherited from TextRedaction.) |
![]() | RegularExpression |
Gets the regular expression to match.
|
Name | Description | |
---|---|---|
![]() | ApplyTo |
Applies the redaction to a given format instance.
(Overrides RedactionApplyTo(DocumentFormatInstance).) |
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ProcessAsTextual |
This method applies a given Regular Expression to an instance of the doucument, if it implements ITextualFormatInstance interface and returns RedactionStatus.Skipped otherwise.
(Inherited from TextRedaction.) |
![]() | ToString | (Inherited from Object.) |
The following example demonstrates replacing text using the regular expression.
using (Redactor redactor = new Redactor(@"C:\sample.pdf")) { // replace with text redactor.Apply(new RegexRedaction("\\d{2}\\s*\\d{2}[^\\d]*\\d{6}", new ReplacementOptions("[removed]"))); // replace with blue solid rectangle redactor.Apply(new RegexRedaction(@"^\d+[,\.]{1}\d+$", new ReplacementOptions(System.Drawing.Color.Blue))); redactor.Save(); }