__init__ constructor

init

Initializes a new instance of RegexRedaction.

def __init__(self, pattern, options):
    ...
Parameter Type Description
pattern str Regular expression to search and replace.
options ReplacementOptions Replacement options (textual, color).

Example

from groupdocs.redaction.redactions import RegexRedaction, ReplacementOptions

redaction = RegexRedaction(r"\d{2,}", ReplacementOptions("[NUM]"))

init

Initializes a new RegexRedaction instance.

def __init__(self, regex, options):
    ...
Parameter Type Description
regex System.Text.RegularExpressions.Regex Regular expression to search and replace.
options ReplacementOptions Replacement options (textual, color).

Example

from groupdocs.redaction.redactions import RegexRedaction, ReplacementOptions

redaction = RegexRedaction(r"\d{2,}", ReplacementOptions("[NUM]"))

See Also