Extract Specific Text from Mail

Hello,
I simply wanted to pull the request number from the mail body.
Please ref the snap shot .

Thanks in advance.
Mail Text

Hi @Gagan_Chaudhari

Is the request number. Keyword constant for all the email.

Thanks

Hi @Gagan_Chaudhari ,

If the Format stays in the same way for all the emails that you want to extract the Request Number, then you could try the Below Expression :

System.Text.RegularExpressions.Regex.Match(EmailBodyStr,"(?<=Your Request Number is :-).*",System.Text.RegularExpressions.RegexOptions.IgnoreCase).Value.ToString.Trim

Here, EmailBodyStr variable is of the String type which contains the body of the email.

Thanks for the quick response.

Many times its same but in future it may change.

Would be appreciated if could help with both scenarios ( request number, constant and different for future reference).

Thanks

Hi @Gagan_Chaudhari

Please try out the Regex pattern provide by @supermanPunch.

Let us know if you still face any issue.

Thanks

1 Like

Thanks @supermanPunch for the Regex pattern.

Thanks @suraj.setty for support

1 Like

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