Unable to get the enum output using Regex when the input is email body

Hi All,

I am using System.Text.RegularExpressions.Match(in_mailMessageRetrieved.Body.ToString,“\b[A-Z]{3}\b(?=\n\nSTART_DATE)”).Value to get the text “OMO” from the string shown in the below screenshot.

The input variable in_mailMessageRetrieved.Body is the body of an email. Surprisingly, when this body is copied from the output panel, the regex is working as expected and the outing is getting generated . But when the input is given as in_mailMessageRetrieved.Body, the enum output is not returning any value.

Thanks in advance for the help.!!!

Hi,

Can you try to check (or share, if possible) content of in_mailMessageRetrieved.Body using WriteTextFile activity?

Regards,

Tried writing the body to text file and then reading it , still it doesnt work.

The email body content is

ONBOARDING_TYPES

Ocu

PAYOUT_SUBTYPES

AMO

START_DATE

2024-11-01

END_DATE

2024-11-30

FB_ENTITIES

FBUS

Hi,

If possible, can you share it as file?

Regards,

Shared the data in the previous message

Exact data is necessary to create regex pattern because there might be difference with linebreak code etc.

Mail Body.txt (135 Bytes)

Please get it as mail body and then try to extract it using regex

Hi,

Can you try the following pattern? Because the string uses CRLF as linebreak

\b[A-Z]{3}\b(?=\r?\n\r?\nSTART_DATE)

Regards,

When the input is passed as a normal string, i am getting the result, but when its in the form of mail.body, its returning null as the output

This worked, Thank you

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