Regex in between lines


Can someone help me with a regex to get the text in between “PaymentHistory” and “/PaymentHistory”

I need all text in between that. Fully understand I could use xml to do it but would prefer RegEx. Reason is getting the text in xml format is a bunch more steps. Let me know!


“ln literal=“y” No complaints/ln”

"ln literal=“y"Nothing./ln”


Had to add in “” to make the text appear “” is actually meant to be < and >

Hi Asanka,

Use below regex

str_Result = System.Text.RegularExpressions.Regex.Match(str_input.tostring,"(?<=PaymentHistory).*(?=/PaymentHistory))")

Hope it will work. Let me know in case of issue

Tried it in the regex tester and no luck! I think it has to do with the data being on different lines

you input string is on same line?

have a look here:

as .* not matching line breaks

we just include \n and \r - last for beeing prepared for the windows world


not working for me:

done with

Also working in regexstorm

in your case just enable the multiline flag. However as it should run within uipath, do quick test there

1 Like

BOOM! It worked. Thanks so much!

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