Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Referencing Groups in Regex matches

When referencing groups in regex matches. There is no way in Win Automation to reference the values in the different parentheses directly from a single action.

For example: We have the variable with the value: "Hello Softomotive" and the regex expression: "(Hello )(.*)"

Using a Regex action (for example Parse Text) we store the results in the variable Matches

In UiPath and other software I can reference the value in the first parenthesis by typing Matches(0).Groups(1).value. This would give me "Hello "
Using Matches(0).Groups(2).Value would give me "Softomotive"


This post was created by the Softomotive Support Team. Thank you Thomas Hviid Petersen for the suggestion!”


1 Comment

Winautomation uses .net regex engine, what you wish to di is is regex backrefetence syntax, where token \1 for first capture group ... 1st group within ( ) and \2 ... for 2nd Capture group within ( ) ...etc
Login or Signup to post a comment