Check template match Version 6 (Net)

Action group: text


Description

Checks if the text matches the specified regular expression. 

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
TextSource text for processingRobin.String
Yes
PatternThe regular expression pattern to matchRobin.String
Yes
Results
ResultA boolean variable to which the test result will be written.Robin.Booleantrue

Special conditions of use 

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

Example of use 

Task

There is a text variable "Input text" with value = 6. We need to check if the value of the input text variable matches the regular expression: \d .  If the condition matches, output the message - "the text matches the regular expression", if it does not match "the text does NOT match the regular expression". 

Solution

Use the "Check template match", "If", "Show message" actions.  

Implementation

  1. Create a boolean variable to which the result of the "Check template match" action will be written and a string variable "Input text" with the number 6.
  2. Move the "Check template match" action to the workspace and set its parameters. 
  3. Move the "If" action to the workspace and set its parameter. 
  4. Add a "Show message" action to the "Truth" branch and set its parameter. 
  5. In the "False" branch, add a "Show message" action and set its parameter. 
  6. Click "Start" in the top panel. 

Result

The program robot completed successfully.  

The result is displayed in a dialog box.


 

  • Нет меток