Regex - Match activity - No results

Hello everyone,

I am facing issue with my regex. I have a invalid json file and I need to match one exact part.
My regex works on regex101 and also in the UiPath editor, but in runtime I am getting no results.

Can you help me out? Is it a regex flag problem?

My regex: (?<=EXCEPTION_REASON",\s{5}“value”\s:\s")[\s\S]*(?="\s{3}}\s]\s})
Test string:
“value” : “First line of text
Second line of text
Third line of text”
} ]


Thanks, Eduard.


Did we try to mention that matches output variable in a writeline activity and check for output
Like this

If it is coming in editor then output will come for sure

Cheers @Eduard

Hey, yes I did, it´s empty - as you can see the matches object is empty on the screenshot.

It’s ienumerable
Mention the index position

Only then we can see the value

Hey, even in writeline there are no results for my regex:

I would like to know whether Is it coming in matches or group when tested in regex101

Hi @Eduard
use matches.ElementAt(0).ToString


Then try with the his expression in a assign activity

Str_output = System.Text.RegularExpressions.Regex.Match(str_input,”your expression”).ToString

Cheers @Eduard

I did try this, same result - returns no value


Make sure input variable has some value in it or the right input is passed to the activity


Hi @Eduard
Try this pattern

(?<="EXCEPTION_REASON",\s+"value" : ")[\w\r\s]+

, TRY this pattern

Nived N
Happy Automation

Quantifier is not allowed to be used in lookarounds.

It could be the case that the windows typlical line breaks composed by \r\n
will lead to failling due 5 is less then needed


Ok so what is the pattern you propose? Strange is that the one I use works both in 101regex and UiPath studio regex editor - but not in runtime.

you readin a text file, right? then the \r\n comes into picture

Love it, you helped me solve it after half day.
So the working regex is like this:


have a look on following:
then we are compatible in both worlds but will not validate in regex101, but maybe works with regexstorm

As an alternate we can do:

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