Extracting invoice number (regex)

Capture4

how can i extract invoice number from above using regular expression

Hello @asiv.balan,
Please use write text file activity to see the structure of pdf.
And then find the patterns before and after the invoice number, ie, 13882 and apply regex accordingly.

1 Like

Capture5

ya i am getting text file like this, please explain me the reg ex for getting invoice number

Try using this expression - ā€œ\d{1,2}/\d{1,2}/\d{2,4}\n\d+\nā€

1 Like

@sakshik thank you sakshi i will check it

@asiv.balan Check if the Invoices you have will always be in the Same format or not.

1 Like

ya @supermanPunch same format only

@asiv.balan Then What @sakshik suggested Should work :sweat_smile:

1 Like

Whether the length of the Invoice number will be constant( For example 5 digits)??

5 digits

Then use this below code,
System.Text.RegularExpressions.Regex.Matches(InputString,ā€œ\d{5}ā€)(0).ToString

2 Likes