This is the body of an email:
Region: Netherlands&&
Site: Zoetermeer&&
Project: Not existing Team&&
Subject: Sign out licences&&
What do you want to achieve?:
Please sign out the following licenses
Inbound licenses
Outbound licenses (Interaction Dialer Add-On and Interaction Scripter)
Interaction Recorder Access licenses
&&
I would like to catch everything between ": " and “&&”. So for instance: “Netherlands”, “Zoetermeer”, “Not existing Team” etc.
I used Regex-code for it: (?<=Region: ).*(?=&{2})
The result is saved as a IEnumerable.
I have tested this with a Write line (For example: ienumRegion(0).Value) and this works with Region, Site, Project and Subject.
For “What do you want to achieve?:” I used (?<=What do you want to achieve[?]:).*(?=&{2})
Also this result is saved as a IEnumerable
However if I test this with a Write Line With in it: ‘ienumAchieves(0).Value’ I receive this message: Object reference not set to an instance of an object.
What am I doing wrong?
Thanks that works, but not for strAchieves:
Therefor I used: System.Text.RegularExpressions.RegEx.Match(strBody,“(?<=What do you want to achieve[?]:)[A-Za-z].*(?=&&)”).ToString. The result is empty…
What am I doing wrong? Is it because this is multiline?
Thanks, this is helping me a lot!!! Just a small issue: the ending && after the input at “What do you want to achieve” is sometimes on a new line (Then your solution works great!! ) but also sometimes right after the last character(Then it doesn’t work ), like “licenses&&”.
Any idea how to solve this?
Again: many thanks in advance!!