Extract by template Version 7 (Java)
Action group: Text
Description
Retrieves text matching the specified regular expression.
Action icon

Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters |
Source text | Text to make action on | Robin.String |
| Yes |
Pattern | The regular expression pattern to match | Robin.String |
| Yes |
Results |
Result | Array variable that contains pattern matching strings | Robin.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
- Create a variable "Collection" to which the result of the "Extract by template" action will be written.
- Move the "Extract by template" action to the workspace and set its parameters.

- Create a variable "Text variable" into which the result of the "Get value by index" action will be written.

- Move the "Get value by index" action to the workspace and set its parameters.

- Move the "Show message" action to the workspace and set its parameters.

- 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.

