Help : Regular Expression

Hi ,

Can anyone of you provide me the regex to extract data for following string?

Dear Team,
Below are the sales details for Aug’23.
Sales for 24.08.2023.
CB Business
Description
For Today 
 For the month 
 YTD Last day 
Turnover (Cr) 
 0.41 
 31.75 
 31.34 
Volume (MT) 
 64.38 
 1,595.330 
 1,530.95
Regards,
XYZ

Expected output:

Description
For Today 
 For the month 
 YTD Last day 
Turnover (Cr) 
 0.41 
 31.75 
 31.34 
Volume (MT) 
 64.38 
 1,595.330 
 1,530.95

Thanks,
Vinit Mhatre

Hi @Vinit_Mhatre

Check the below regular expression -

Store the Input data in a String variable called Input

- Assign -> Output = System.Text.RegularExpressions.Regex.Match(Input,"Description[\s\S]+(?=Regards)").Value

Check the below workflow -

Hope it helps!!

Actually, I don’t want to extract the data based on the second phrase, which is “Regards”; I want to take the data after the description until the last number, after which the data will be dynamic.

Okay @Vinit_Mhatre

Then check the below,

Store the Input data in a String variable called Input

- Assign -> Output = System.Text.RegularExpressions.Regex.Match(Input,"Description[\s\S]+\d+").Value

Hope it helps!!

2 Likes

Thanks for your help

1 Like

It’s my pleasure… @Vinit_Mhatre

Happy Automation!!

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