VanjaV
1
Hi.
One workflow sends mail with body to another like this:
MailAddress: some.one@company.com
NextTopic:
The second workflow receives the mail address in the mail body as hyperlink.
It gets wrong data out of received mail when using this regex:
“(?<=MailAddress: )([\S\s]*?)(?=NextTopic:)”
Any suggestions?
Thx. KR, Vanja
lrtetala
(Lakshman Reddy)
2
Hi @VanjaV
Can you try this
emailAddress = System.Text.RegularExpressions.Regex.Match(mailBody, "(?<=MailAddress: )([^\s<>]+?@[^\s<>]+)(?=\s*NextTopic:)").Value
Regards,
Hi @VanjaV ,
Could you let us know what is the expression that you have used to extract the value using regex ? Is it the activity or the Regex.Match() method ?
Also, the other data getting extracted, does it have any resemblance to the email format ?
VanjaV
4
Hi, I am using this activity:
String data get extracted OK with regex like this.
Hi @VanjaV
Try this expression in assign activity
System.Text.RegularExpressions.Regex.Match("yourstring","[A-Za-z.\\d-]*@[A-Za-z\\d.-1*$]*$").ToString.Trim
Regards,
Gowtham K
lrtetala
(Lakshman Reddy)
6
@VanjaV
(?<=MailAddress: )([^\s<>]+?@[^\s<>]+)(?=\s*NextTopic:)

Regards,
VanjaV
7
Yes, it works if you read it from the string.
But it does not work if you read it from a mail with hyperlink.
My regex now returns:

I will do a second regex out of it.
Thx for all advices.
system
(system)
Closed
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.