Divide Text

The Divide Text action divides the text contained in the found tag into pieces using a pattern and an expression. It is useful when looping over these pieces in a subsequent step.

Properties

The Divide Text action is configured using the following properties:

Pattern

Specify a pattern that will be matched against the text in the found tag. For every match of the pattern, the expression in the Output Expression field will be evaluated. The found tag will then be replaced by a <span>-tag, which, for each match of the pattern, contains the result of the expression surrounded by another <span>-tag.

Ignore Case

If this property is checked, then the pattern matching will be case insensitive.

Output Expression

This field contains an expression that is evaluated for every match of the pattern.

Example

If the found tag is the "Kofax RPA" text on this page:

<html>
  <body>
    <p>
      Kofax RPA
    </p>
  </body>
</html>

and the Pattern is set to "\S+\s?" (meaning at least one non-whitespace character, followed by an optional whitespace), and the Output Expression is set to "$0" (meaning the entire matched text), then the output will be:

<html>
  <body>
    <p>
      <span>
        <span>Kofax</span>
        <span>RPA</span>
      </span>
    </p>
  </body>
</html>