Regex, 2 first lines

Vat-nr. 457674456
Department 4500 Pepsi Co
Employeeno. 6000 Avenue 5
Date 18-11-11 Newark

John Doe Smith
Test Road 2
1234 Test Town



I want the first two lines in the second paragraph, here:
John Doe Smith

strong text
Bonus: Can you explain the solution with the \r and \n

Hello @LauraMM

Is the word accountant constant?

Is there anything else that you can tell us about the pattern of text?

1 Like

Sorry. No it’s not a constant. It could be Director, Cleaning etc.

What I know is that it’s always the second paragraph that I want the first two lines from.

Hey @LauraMM

Have a look at this potential solution.


However, you want the first match ONLY.

You will need to use an assign activity like this.

Stringvariable = REGEXRESULT(0).tostring

Update the above capital letters with the Result variable from the matches activity.

Hopefully this helps :blush:

1 Like


For the bonus point - take a look at this link

Hopefully this helps also :blush:

1 Like

Thank you!!!

Check this: Regex first lines after \r\n\r\n

1 Like

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