Problem with the "Matches" activity

Hi, I have a problem with the matches activity, I use a regex to get a shipping label number but sometimes it doesn’t work. I looked up the problem but couldn’t find any with the regex or the text generated by the OCR.

Long story short, I have a good regex, good text file, when I test it in the matches activity manually it recognises the good number but the activity outputs nothing when you run the robot.

Any idea what may be the problem?

Hi @Francois_Pare-Lavoie, this is your first post! welcome to the best community :slight_smile:
Regarding the activity, since you say the RegEx and the text are correct, maybe you’re just missing to assign the output variable into the activity? Let me know

I forgot to mention it but no, i have an output. the robot runs great half the time.
and here’s the regex:


nothing unusual here


Welcome to UiPath forum

Well then try using IS MATCH activity and get the Boolean variable as output
Based on that let’s check whether the Regex expression used is fine or not

Use a if activity like
boolvariable = True

If true then it goes to then block where keep your matches activity

Cheers @Francois_Pare-Lavoie

I tried it, but I have the same problem in the is match activity.
when I debug and go over the activity I see the input is good, the expression is too, but the result remains false.
when I test it it detects the good number (the regex changed because its another company):

but when it runs it doesn’t work

Did you check the Multiline option?


I never had to with all the other cases I have but I tried it and no difference