How do I use string manipulation to extract specific fields?

Hey there,

I’m trying to scrape potential customer information from incoming emails; I’ve successfully got the email but need some help with the string manipulation to get what is required (sorry, I’m new to this!). The output email variable is pUnreadEmails - how would I then use the assign function to get the relevant below?

So an example of the info (I made it bold):

Customer details:
Name: John Doe
Telephone: 07123456789

Car details:
Make: Mercedes-Benz
Model: EQA
Derivative: ABC 123 140kW AMG Line 66.5kWh 5dr Auto
Type: Personal Lease
Monthly Price: £500.95inc VAT
Initial Payment: £1,500.86 inc VAT
Admin Fee: £0.00 inc VAT
Term: 48 months
Annual Mileage: 8,000
Your Deal ID: A-12345-4D-60M-9000K

Appreciate your help!


You can use Regex Expression for this case

If you want to extract individually for example for Name, check below


Else another way is as below

Later you can split the string and separate the values

Hope this may help you


A general quick catch can be done by following:

refering to the groups:

Also have a look here:


Thank you for this; I was hoping to avoid RegEx as it can be quite complicated (and also customers can be unreliable for consistency and typos).

Therefore, string manipulation using splits etc might be better, though I’m not quite sure how to do it.

give a try on using splits:

  • first split on LineBreaks - Environment.NewLine
  • second split on :

then check defensive if there was a keyname : value occurence and retrieve it from the split result array