Use Write line to show the regex expression result in the output

Hi, I obtain the below error message

when I try that the system write the number retrieve by the regex expression.
This is my regex expression:

And it retrieves the correct number now:
In the below example its 40121

I want now to use a write line activity in order the system write the number (40121) in the output but I obtain that error message.

@mce

As per error it says that the value is either not retrived or no match is found or the variable itself is not given in the matches expression activity

Cheers

strange the value seems retrieved (see below )

Do you have another idea ?

Hi @mce ,

Could you double check if you are assigning the output variable to the Matches Activity ? Also, Do Check if there are duplicate variables used in the variables Panel.

we would suggest to work with the debugging panels, preferred with the immediate panel. You can prototype and check directly:

Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

@mce

As suggested please check the debugging panel…and in matches properties you have regex options try using single line or multiline option

Cheers

Yes I did

and there is no duplicated variable

in multi line option:

and single line option:

the same issue. It seems that the result is not recognized, strange

@mce , Could you try replacing the \n in the regex expression you’re using with the below and let us know if that works :

\r?\n

@mce

Try change \n in regex to \s.

\s is a shorthand to [ \t\r\n\f]

Also, as mentioned before, use imediate pane to debug your expression

Hi

You might want use an If statement to check you received a result or use a Regex.IsMatch before trying to extract a result.

Could you paste your sample text in a reply?

Give a try on the following regex pattern.

(?<=Dependent care benefits[\r\n\s]+)[\d]+

Preview it here

Hopefully this helps,

Cheers

Steve

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.