You are here: Reference > Rule types > Parse Transforms > Parse Transform form - Completing the Transform tab

Parse Transform form
Completing the Transform tab

  1. About 
  2. New 
  3. Transform 
  4. Compile 
  5. History 

Use the Transform tab to record a regular expression.

Field

Description

Pattern  
Regular expression

Enter a regular expression conforming to the Java syntax accepted by the java.util.regex class. You can use the typical syntactical elements, including brackets [ ], predefined character classes (\s for a white space character), boundary matches (\b for a word boundary), quantifiers, and so on.

When you save the Parse Transform form, the Pega 7 Platformchecks the syntax of your regular expression. See http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html for the authoritative definition of the syntax accepted here.

You can use the Regular Expression tool to develop and validate the expression. See About the Regular Expression tool.

Convert

Optional. Enter Java code to convert and validate a source text string, and optionally to form a Pega 7 Platformproperty type such as Date or DateTime. The Java code executes for each regular expression pattern match in the source text.

Click the Gear icon to start your Java editor or Notepad. Within the Java code, the following read-only variables are available:

  • String aSource — The source string that was searched
  • String aMatch — The substring that matched the regular expression pattern
  • int aMatchStart — The location (character offset) within the source string where the pattern match starts
  • int aMatchEnd — The location (character offset) within the source string where the pattern match ends
  • String aMatchGroups[] — An array of all subgroup matches for the pattern

Within the Java, set the java.lang.String variable sReturn to the approved result, or null to indicate invalid or error conditions.

Resulting Type  
Output Type Select the property type of the output value.

About Transform rules