Repeatable replacement by regular expression

The repeatable replacement by regular expression policy uses a repeatable method to mask a string with characters that match each type of character that is replaced. For example, numbers are replaced with numbers, and lowercase letters are replaced with lowercase letters. The policy uses a regular expression to determine which characters to mask in the string. The characters used for masking are obtained from a specified character set. The policy masks characters that are part of the character set only.

The following mask methods are available:
CRC
The cyclic redundancy check (CRC) method masks each string in a repeatable manner; however, the CRC method may not mask each string with a unique string.
Hash
The hash method masks each string in a repeatable manner; however, the hash method may not mask each string with a unique string.
Map
The map method masks each string in a repeatable manner and with a unique string.
JavaScript policy syntax

This policy is available with the function ScrambleMask.repeatableReplacementByRegularExpression().

ScrambleMask.repeatableReplacementByRegularExpression(record.getItem( '<arg:inputAttribute>'), '<arg:regularExpression>', '<arg:language>', '<arg:scrambleType>')

For example, to mask the lowercase characters from a-h with characters from an English character set using the CRC method, enter the following syntax:

ScrambleMask.repeatableReplacementByRegularExpression(record.getItem('/DEMO/ORDERS/ORDER_ID'), '([a-h]+)', 'English', 'CRC')

Argument Description
inputAttribute The attribute containing the string to mask.
regularExpression A regular expression describing the characters to mask in the input string.
language The language for the character set that provides the characters used for masking. If a character set is not specified, or if the character set is not supported, the English character set is used. For a list of supported character sets, see Language character sets supported for scramble mask policies.
scrambleType The mask method: CRC, HASH, or MAP.