Issues with regex match

Hi, this regex is working in the regex tester but it’s not working in UiPath.
Lookbehind doesn’t work either.

This is the regex code:

Number of Applicants: (\d+)

Test String:

Department: 
Number of Applicants: 13
* Applicant has no documents.Miss RACHEL Samuil
Applicant address:  624 Senja Road

Desired Outcome : 13

Thank you xoxo

@sangasangasanga Try something like below.

(?<=Number of Applicants: )(\d)+

@sangasangasanga

Please use the Matches activity.
More details on this activity can be found here - https://activities.uipath.com/docs/matches

Regards,
Karthik Byggari

@Manjuts90 Hi, I tried. When using IsMatch it is showing as false but in the regex tester it shows as 1 match
@KarthikByggari I am using matches activity :slight_smile:

Hey @sangasangasanga

What method are you using to extract these values via Regex?

If you’re using “match”, you’ll end up with the FIRST match, instead of all the matches.

Suggestion: Use the matches activity OR the method Regex.Matches() to extract ALL the values.

Attach your workflow here. Let me take a look at it, and I’ll revert back.

@siddharth
I am using both ismatch and matches activity

Do check if "Number of Applicants: " is exactly the same as that in the input. Maybe, the input has extra spaces after the colon (:) or in between the words.

Meanwhile, I’ll look into the workflow and revert back asap.

Hi, my input file is a pdf. I am reading pdf then using the match activity. I got the test string from the ‘read pdf’ activity for regex. However, when I use ‘write text file’ and tried with that string, it works. Even though both are exactly the same including spacing. weird but okay

1 Like

So shall I consider this resolved?

yes. Thank you :smiley:

You’re most welcome, @sangasangasanga Have a nice day!

1 Like

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