The replace characters by regular expression policy masks each character in a string with a randomly generated character that matches the 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.
This policy is available with the function ScrambleMask.replaceCharactersByRegularExpression().
ScrambleMask.replaceCharactersByRegularExpression(record.getItem( '<arg:inputAttribute'), <arg:regularExpression>, <arg:language>)
For example, to replace the lowercase characters from a-h with characters from an English character set, enter the following syntax:
ScrambleMask.replaceCharactersByRegularExpression(record.getItem('/DEMO/ORDERS/ORDER_ID'), '([a-h]+)', 'English')
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. |