Regex between two fields

Hello,
Is it possible using Regex to get the text between “Explain the following” and “Testing this on UiPath”? If so, how?

Explain the following
glkfj
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
lllllllllllllllllllllll

ffffffffffffffffffffffffffffffffffffff

Testing this on UiPath

Try this
Var will be your string
Var.Split({“Explain the following”},StringSplitOptions.None)(1).Trim.Split({“Testing this on UiPath”},StringSplitOptions.None)(0)

Although it is not Regex it works.
Is it possible to create this in Regex?

Hi @LarsFeilberg,

I think @ImPratham45 suggestion will work but if you want it with regex then, here’s the pattern you can use —>

(?s)(?<=Explain the following).*(?=Testing this on UiPath)


https://regex101.com/r/h8BYot/1/

1 Like