Splitting a second instance while keeping the lines intact?

Hi peoples, I need to split a large section of text by the second ‘enter’ keystroke, so for example:

aaaaaa
bbbbbb
cccccc
dddddd

I need to get “aaaaaa
bbbbbb” to be set as a new variable, but I don’t want to remove the enter keystroke in between those two first lines because I want to remove them from the original. I’m currently using the assign activity: vMyParsedVar = split(vOriginalVar, environment.newline)(2) – but I belive this is removing the first ‘enter’ keystroke in the new value. Any way around this?

Hi,

Can you try the following expression?

vMyParsedVar = System.Text.RegularExpressions.Regex.Match(vOriginalVar,"^.*\n.*?(?=\r?\n)").Value

Regards,