Need help in regex code

Hi all, i need help to get data between 2 strings using regex. In between those 2 strings there is lots of data like 4-5 lines. This is my email body. I can’t share it here but the scenario is i need to get all data in between 2 strings.
Starting string is FORMAT end string is DOWNLOAD.

Can anyone help me with regex code. The values in between those strings will change every time it’s not constant

Hi @Rreddy

Can you try below

(?<=FORMAT)([\s\S]*?)(?=DOWNLOAD)

System.Text.RegularExpressions.Regex.Match(Input,"(?<=FORMAT)([\s\S]*?)(?=DOWNLOAD)").Value.Trim

Regards,

1 Like

@Rreddy

you dont need a regex also split should suffice…str.Split({"FORMAT","DOWNLOAD"},StringSplitOptions.None)(1)

cheers

Thanks @lrtetala . It’s working fine

1 Like

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