Parse text using a regular expression

In discovery patterns, you can parse text into variables using Regular expressions as the parsing strategy.

Before you begin

  • Familiarize yourself with the Regex Java syntax:https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html

  • Navigate to the relevant pattern step:

    1. On the pattern form:
      • Select the relevant identification section for Discovery.

        Or

      • Select the relevant identification or connection section for Service Mapping.
    2. Select the relevant pattern step or click to add a step.

Role required: pd_admin

Basic knowledge of programming is desirable.

Procedure

  1. Select one of the parsing operations from the Operation list.
  2. Click Retrieve or Retrieve File Content to display the actual file in the Output pane.

    Display file content in the Output pane
  3. Select the Regular expression from the Define Parsing list.
  4. Fill in the fields, as appropriate.
    Field Description
    Regular expression Specify the regular expression. You cannot select text in the text box using this parsing strategy.

    You can only specify a single expression.

    To extract multiple values, define several expressions enclosing each expression into parentheses.

    Matching of variables to parentheses occurs according to the order of the parentheses sets. (The first variable is matched to the first set of parentheses, and so on).

    Set variables as
    • Table: Select this option if the target table contains multiple columns.
    • List: Select this option for a single string (scalar). List must contain more than one variable.
  5. To end the discovery process if no results are found, select the If not found check box.

Example


Defining a regular expression