How to get the first line in an invoice using regex

Hi I want to extract the first line in multiple invoices where the text before it or after it changes in every document. Please help me to build the regex to get it for all the documents. Below are the sample screenshots.

sample 1:
image

sample 2:
image

I just highlighted the text which I want to extract.

Regards,

please provide sample pdf

Hi @raju_alakuntla

Try this

System.Text.RegularExpressions.Regex.Match(Input,"([A-Z][A-Za-z]+\s+[A-Z][a-z].*[A-Za-z]+.?)").Value

Hope this helps!!

@raju_alakuntla

use this

inputstr.Split(vbLf,StringSplitOptions.RemoveEmptyEntries).First

gives you the first line value

in yesterday’s post I have shared with you. can you please refer them and find the solution for this?

can I use this in assign activity?

@raju_alakuntla

yes

outputstr=inputstr.Split(vbLf,StringSplitOptions.RemoveEmptyEntries).First

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