Skip to content

Regex Decompose

See Regex Decompose for more information about this algorithm framework.

Creating a Regex Decompose Algorithm via API

  1. Retrieve the frameworkId for the Regex Decompose Framework. This information can be retrieved using the following endpoint:

    algorithm   GET /algorithm/frameworks
    

    The framework information should look similar to the following:

    {
          "frameworkId": 5,
          "frameworkName": "Regex Decompose",
          "frameworkType": "STRING",
          "plugin": {
              "pluginId": 7,
              "pluginName": "dlpx-core",
              "pluginAuthor": "Delphix Engineering",
              "pluginType": "EXTENDED_ALGORITHM"
          }
    }
    
  2. Create a Regex Decompose algorithm via the following endpoint:

    algorithm   POST /algorithms
    

    Configure a new algorithm using the JSON formatted input similar to the following:

     {
          "algorithmName": "ExampleRegexDecomposeAlgorithm",
          "algorithmType": "COMPONENT",
          "frameworkId": 5,
          "algorithmExtension": {
              "trimInput": true,
              "requireMask": false,
              "maskPatterns": [
                  {
                      "regex": "([0-9]+)-([a-z]+)",
                      "actions": [
                          {
                              "type": "REDACT",
                              "algorithm": null,
                              "redactString": "asdf",
                              "redactCharacter": null
                          },
                          {
                              "type": "REDACT",
                              "algorithm": null,
                              "redactString": null,
                              "redactCharacter": "x"
                          }
                      ]
                  }
              ],
              "fallbackAction": null,
              "maxInputLength": 65536
          }
    }
    

Regex Decompose Algorithm Extension

  • maskPatterns

    Array of MaskPattern objects
    Defines the mask pattern(s) of the algorithm. See Regex Decompose MaskPattern Extension below for more information.

  • fallbackAction

    MaskAction
    The action that should be applied to the entire input if none of the defined regular expressions match. If no pattern matches and no fallbackAction is set, non-conformant data handling will be triggered. See Regex Decompose MaskAction Extension below for more information.

  • requireMask (default="true")

    String
    A boolean that represents whether the input must be masked. When this is true, patterns are matched until one changes the input. If no pattern can change the input and no fallbackAction is set, non-conformant data handling will be triggered for this value. If false, the first matching pattern will apply regardless of whether it changes the input. Any difference in value from the input is considered successful masking.

  • trimInput (default="true")

    String
    A boolean that represents whether to trim whitespace from the beginning and end of the input prior to processing. The same leading and trailing whitespace will be reintroduced into the masked value. This option is provided to simplify the regular expressions that can be used in maskPatterns, as they no longer must account for and preserve leading and trailing whitespace.

  • maxInputLength (default=65536, minValue=1)

    Integer
    A value that represents the maximum character length of input the algorithm will attempt to process. If the input length exceeds this value, non-conformant data handling will be triggered for this value.

Regex Decompose MaskPattern Extension

  • regex

    String
    A Java 8 style regular expression used to match the masking input.

  • actions

    Array of MaskAction objects
    Defines the action(s) to be applied to the match or capturing group(s) when the regular expression matches. See Regex Decompose MaskAction Extension below for more information.

Regex Decompose MaskAction Extension

  • type

    String
    The type of action to the input that matches the regex. Must be one of the following enum values:
    - PRESERVE - the value or capturing group is not masked and remains unchanged
    - TRUNCATE - the value or capturing group is replaced with ""
    - REDACT - the value or capturing group is replaced by a value or repeated character
    - APPLY_ALGORITHM - the value or capturing group is replaced by the output of another chained masking algorithm

  • algorithm

    AlgorithmInstanceReference
    A reference for the algorithm to use when "APPLY_ALGORITHM" is the MaskAction type. The algorithm must have maskingType "STRING". The algorithm will never be passed a null or empty value to mask. See AlgorithmInstanceReference Extension below for more information.

  • redactCharacter

    String
    The character to use to replace the input when "REDACT" is the MaskAction type. Each character in the portion of input matched is replaced with this character. Length of the matched input is preserved. Only one of redactCharacter or redactString may be specified for a given MaskAction.

  • redactString

    String
    The string to use to replace the input when "REDACT" is the MaskAction type. The entire matched portion is replaced with this string. Use of this option will cause the length of the value to change during masking unless the matched portion of input happens to have the same length of the redactString. Only one of redactCharacter or redactString may be specified for a given MaskAction.

AlgorithmInstanceReference Extension

  • name

    String
    The algorithm instance name.