List of rules to apply for replacing sensitive data.
Each rule is a StringNodeRule, which contains a regex pattern to match and an optional replacement string.
rules: list[StringNodeRule] = [{'pattern': rule['pattern'] if isinstance(
rule['pattern'],
re.Pattern) else re.compile(rule['pattern']), 'replace': rule['replace'] if isinstance(rule.get('replace'),
str
) else '[redacted]'} for rule in rules]