com.groupdocs.redaction

Class RegexRedaction



  • public class RegexRedaction
    extends TextRedaction

    Searches for regular expression matches and replaces them in document's text

    • Constructor Detail

      • RegexRedaction

        public RegexRedaction(String pattern,
                      ReplacementOptions options)

        Creates new instance

        Parameters:
        pattern - Regular expression to search and replace
        options - Replacement options (textual, color)
      • RegexRedaction

        public RegexRedaction(Pattern regex,
                      ReplacementOptions options)

        Creates new instance

        Parameters:
        regex - Regular expression to search and replace
        options - Replacement options (textual, color)
    • Method Detail

      • getRegularExpression

        public final Pattern getRegularExpression()

        Regular expression to search and replace

      • applyTo

        public RedactionLogEntry applyTo(DocumentFormatInstance formatInstance)

        Applies redaction to given format instance

        Specified by:
        applyTo in class Redaction
        Parameters:
        formatInstance - An instance of a document to apply redaction
        Returns:
        Status of redaction: success/failure and error message if any