Extract by template Version 7 (Java)

Action group: Text


Description

Retrieves text matching the specified regular expression.

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
Source textText to make action onRobin.String
Yes
PatternThe regular expression pattern to matchRobin.String
Yes
Results
ResultArray variable that contains pattern matching stringsRobin.Collection

Special conditions of use

You can read about the syntax of regular expressions in open sources, e.g. https://regex101.com/

Groups are not supported (use of "()" ).

Example of use 

Task

There is a variable "Primary text" with the value: Phone: 631-978-2613. It is required to extract the value in quotes and output it to a dialog box. 

Solution

Use the actions "Extract by template", "Get value by index", "Show message". 

Implementation

  1. Create a variable "Collection" to which the result of the "Extract by template" action will be written.
     
  2. Move the "Extract by template" action to the workspace and set its parameters.
  3. Create a variable "Text variable" into which the result of the "Get value by index" action will be written. 
  4. Move the "Get value by index" action to the workspace and set its parameters.
  5. Move the "Show message" action to the workspace and set its parameters.
  6. Launch the robot using the "Start" button in the top panel. 

Result

The text is extracted according to the template, the required value is displayed in the dialog box. 

 

  • Нет меток