Regex Help - Capturing all Text between a Start and Ending Index

Greetings,

I am trying to capture all of the text starting with say “Item Description” and ending at “Final Quote Amount” (items circled in blue)

I am trying to do something like “Item Description” + (regex for all characters) + “Final Quote Price”

This would be so when I use the ReadPDF activity, it isn’t grabbing everything else on the PDF (not shown in screenshot), and then I can use RegEX on only the text that is captured between the circled blue words.

So, far I am able to figure out: Item Description+\s+\S+\W+Final Quote

But it doesn’t seem to capture everything in between

Would someone be able to kindly point me in the right direction?

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Match(strPdf,"Item Description[\s\S]+?Final Quote").Value

OR

System.Text.RegularExpressions.Regex.Match(strPdf,"(?<=Item Description)[\s\S]+?(?=Final Quote)").Value

Note: the latter returns content without Item Description and Final Quote.

Regards,

This is why you are an MVP. My regex has gotten rusty lately.

Thank you!!

1 Like