How to create regex in same workflow

Hi im sharing a sample pdf ,
It contains two Worker allotment,In some pdfs it will be one,If it is two means i need to create regex for both of them seperately in same workflow itself can any one
Pdf_Sample.pdf (56.8 KB)
please help me to solve this regex issue.
1.WORKER ALLOTMENT (212 HOURS)-25,200.00
I need out put as 25,200.00 and also 212

2.WORKER ALLOTMENT(123 HOURS)-27,200.00
I need Output as 27,200 and 123

Note:212 HOURS and 123 HOURS are static.

In some pdfs Worker allotment will be one at that case also hours will be 212 or 123.
Can anyone please help me to fix this

Hi @Chippy_Kolot

System.Text.RegularExpressions.Regex.Matches(YourString,"\d+(?=\sHOURS)")(0)

image

image

Regards
Gokul

HI @Chippy_Kolot

Regex Expression

System.Text.RegularExpressions.Regex.Matches(ReadPDFText.ToString,"(?<=ALLOTMENT\s\()(\d+)(\sHOURS\)\W+)(.*)")(CInt(item.ToString)).Groups(1)
System.Text.RegularExpressions.Regex.Matches(ReadPDFText.ToString,"(?<=ALLOTMENT\s\()(\d+)(\sHOURS\)\W+)(.*)")(CInt(item.ToString)).Groups(3)

Check out the XAML file

MatchesRegex.xaml (6.8 KB)

Output

image

Regards
Gokul

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