UIpath Matches activity BUG, regex builder error?

Goal
Read pdf using uipath pdf activity, regex out necessary things using regex matches

Description
So i have a working Regex code and is working inside “Test Text” in the matches activities (yellow highlight), its working with other regex tool for vb, its working vb test code environment too.

Problem
when i run the code with pdf reader , regex match activity returns zero result with output string, when i manually put the string in a variable and run without pdf reader regex match return results correctly. I took the string from what pdf reader spits out and compare what i put in a variable , it is identical according to text-compare(and visually). So whats going on ? is this a bug with regex builder matches activity ?

Files work flow and pdf
Jay_Regex.xaml (18.1 KB)

please disable the pdf reader when testing with variable and vice versa


image

ALL DATA IS DUMMY/FAKE DATA, NO PERSONAL DATA INVOLVED

use this instead

all i did was change the \n after (?<review_id>\d*) to a [\s]+
i found out because i tested in .NET Regex Tester - Regex Storm , it should be more accurate than the one in uipath

Review ID: (?<review_id>\d*)[\s]+Review Type: (?<review_type>.*)\nPatient ID \/ Name: (?<id>\d*) (?<name>.*) DOB: (?<dob>.*) Sex: .*\n.* Claim Number: (?<claim_number>\d*) Est Overpayment: (?<est_overpayment>.*)\nDate: (?<service_from>.*) Date:(?<service_thru>.*)

image

have you tried from the pdf ? its not working when the string comes from the pdf

image

Hi

It seems linebreak matter.

Can you try the following pattern?

"Review ID:       (?<review_id>\d*)\r?\nReview Type:  (?<review_type>.*)\r?\nPatient ID \/ Name: (?<id>\d*) (?<name>.*) DOB: (?<dob>.*) Sex: .*\r?\n.* Claim Number: (?<claim_number>\d*) Est Overpayment:   (?<est_overpayment>.*)\r?\nDate: (?<service_from>.*) Date:(?<service_thru>.*)"

This works in my environment.

Regards,

can you try this instead
Review ID:[\s]+(?<review_id>\d*)[\s]+Review Type:[\s]+(?<review_type>.*)[\s]+Patient ID \/ Name:[\s]+(?<id>\d*) (?<name>.*)[\s]+DOB:[\s]+(?<dob>.*)[\s]+Sex:.*Claim Number:[\s]+(?<claim_number>\d*)[\s]+Est Overpayment:[\s]+(?<est_overpayment>.*)[\s]Date:[\s]+(?<service_from>.*)[\s]+Date:(?<service_thru>.*?)[\s]+

also, tick “singleline” in your matches properties
image

2 Likes

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