Regex Expression for below content

After converting into text will be like below.
"
Sample Invoice

Leon Petrou, Inc. Date
155 West Street, WeWork 12/28/2023
United States Invoice Number
(888) 308-8851 19070

Bill To:
Leenti
5 Debra Point
Esik
960-354-7008
bwabersinke0@dailymail.co.uk

DESCRIPTION AMOUNT (USD)

Service Fee 2079

Additional Fee 131

Total 2210

THANK YOU FOR YOUR BUSINESS!"

Thanks In Advance

Hi @Manju_Reddy_Kanughula ,

Can you let us know what actually you want to extract from here?

HI @Manju_Reddy_Kanughula

Can you read the text with setting Preserve format as tru and then share the input string here?

Regards
Sudharsan

Invoice 1.txt (1.0 KB)

@Manju_Reddy_Kanughula

Try this

Sample invoice

System.Text.RegularExpressions.Regex.Match(InputString,"(?s)(?<=Sample Invoice\n{2})(.*?)(?=Bill To)").Tostring.Trim

Bill To

System.Text.RegularExpressions.Regex.Match(InputString,"(?s)(?<=Bill To:\n)(.*?)(?=DESCRIPTION)").Tostring.trim

Email

System.Text.RegularExpressions.Regex.Match(InputString,".*(?=\n{2}\sDESCRIPTION)").Tostring.Trim


Or

System.Text.RegularExpressions.Regex.Match(InputString,".*@.*").Tostring.Trim

Phonw Number

System.Text.RegularExpressions.Regex.Match(InputString,".*(?=\n.*@)").Tostring.Trim


Or

System.Text.RegularExpressions.Regex.Match(InputString,".*(?=\n.*\n{2}\sDESCRIPTION)").Tostring.Trim

Service Fee

System.Text.RegularExpressions.Regex.Match(InputString,"(?<=Service Fee ).*").Tostring.Trim

Additional Fee

System.Text.RegularExpressions.Regex.Match(InputString,"(?<=Additional Fee ).*").Tostring.Trim

Total

System.Text.RegularExpressions.Regex.Match(InputString,"(?<=Total ).*").Tostring.Trim

Regards
Sudharsan

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