User Guide

Regular Expression Text Generator

This section provides a comprehensive description of the regular expression (regex) text generation transformation type.

For a summary of the rule and its compatibility with platform jobs and execution environments, see masking-rules.png Masking Rule Types.

Data Types

The regex text generator supports the following data types:

  • Text

Description

The value is partially or completely replaced by a randomly generated string that matches the supplied regular expression. For example, for an initial value:

abcdef

you could use the following regular expression:

[a-z]{6} 

This would produce an output such as:

mvskyc

Optionally specify Start Index and Length to Replace to replace a part of the input value with the generated text. For example, with an input of abcdef and a pattern of [0-9]{4}, replacing four characters from position 1, an output might be a4321f.

Masking Behavior

The options are described in the following table:

Option

Description

Regular Expression

The pattern that the generated text should match.

For more information about the regular expression syntax supported in the platform, see Regular Expression Syntax. (Click on the RegExp class in the Class Summary table.)

Start Index

Where to start replacing the string. This is required for partial replacements. Start index 0 is the beginning of the string. Index 1 is after the first character of the string.

Length to Replace

The length of the string to replace. This is required for partial replacements. The value entered will be the number of characters from the string that will be replaced.

You can unmask fields that have been masked with the regex text generator.

Examples

Here are examples of regular expressions that you could use to match some example fields and formats:

Field

Format

Expression

Email Address

xxxxxxx@xxxxx.com

[a-z]{7}\@[a-z]{5}\.com

Last Name

xxxxxxxx

[a-z]{8}

Tokenization Behavior