How to get Specific value using Matches activity?

Hi All,

I want to extract total value from invoice pdf using matches activity. I’m able to extract only mail id’s and phone numbers. Rest all it’s a confusion for me.
Could someone please guide me how to configure regular expression. Also share any link where I can learn about RegEx.

Thanks in Advance :slight_smile:

1 Like

Hello @Vaishnav_Tej
Based on your input, we need to frame the regex condition.
The document also should be in the desired format.
For Regex need, share your input and expected output, it help us to provide you a better solution

Kindly refer to this link, it may help you

1 Like

Hello @Vaishnav_Tej
share some sample pdf data with us so that we help you better

For learning check TutotialsPoint and/or W3School etc

1 Like

wordpress.pdf (42.6 KB)

1 Like

@Vaishnav_Tej
Share your Expected output

1 Like

image

I want to extract values of Invoice Number, Invoice Date and Total Due.

Invoice Number INV-3337
Invoice Date January 25, 2016
Total $93.50

1 Like

@Vaishnav_Tej
Refer to this Xaml file, you may get some idea
Forum_PDF_Regex.zip (176.3 KB)

image

1 Like
System.Text.RegularExpressions.Regex.Match(ReadStr,"(?<=Invoice Number\s)[\dA-Za-z-]+").ToString
System.Text.RegularExpressions.Regex.Match(ReadStr,"(?<=Invoice\sDate\s)[A-Za-z]+\s\d{2}\W\s\d{4}").ToString
System.Text.RegularExpressions.Regex.Match(ReadStr,"(?<=Total\sDue\s)[$\d.]+").ToString
1 Like

image

I couldn’t access

1 Like

What exactly to give in Pattern property?

1 Like

Dowload the packages from manage packages
UiPath.pdf.activities

2 Likes

@Vaishnav_Tej
Use assign activity

Var= System.Text.RegularExpressions.Regex.Match(ReadStr,"(?<=Invoice Number\s)[\dA-Za-z-]+").ToString
Var should be string type

1 Like

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