Read email line by line

Hi,

I have a ton of emails with almost same structure, that i try to use UiPath to read and write to database for getting a better overview. And it is the “almost same” that troubles me.

The mails are plain text and looks like this format:

Network name: Some network name
Network number: 1234
Admin name: 1234 Aaron Spelling
City: Hollywood
Timestamp: 06/05/2019 12:37:34
Device description: Switch 1
Alert group description: Operational;
Status: OK Alertcode description: reader OK

But… And here is my problem. Sometimes the emails look like this

Network name: Some network name
Network number: 1234
Admin name: 1234 Aaron Spelling
City: Hollywood
Timestamp: 06/05/2019 12:36:18
Device description: Switch 1
Alertcode description: switch inactive: Disconnected; Returned after 1 minutes, Actual SN 123456789, Version 32.06, Type VLAN switch

How do i catch the change in the last line. Some times the last line starts with “Alertcode” and other times it starts with “Alert Group Description”

I am using a+b assign with
System.Text.RegularExpressions.Regex.Match(strMailContent,"((?<=Network name:).*(?=Network number:))").Value
To read the value into a variable, and later on write it to a database, and that works fine, but i cant seem to wrap my head around the variation in the string.

I cannot change the mail from the sender.

Any help would be appreciated.

Br
Kenneth