How we can extract the text from mail body in the below format which received from dynamic mail body(Mail receives from Get outlook mail Message activity )

i want to extract text (1100,2000,2200) from below Mail Body receives from Get Outlook mail message activity. the Output should be in this format (1100,2000,2200)

Mail Body - @"From: Workflow System SAP_WFRT@GALAXYSURFACTANTS.COM
Sent: Friday,
February 23,
2024 12:23 PM
To: Yogesh Thakur yogesh.thakur@galaxysurfactants.com; Vijendra Joshi Vijendra.Joshi@galaxysurfactants.com; R.K.Singh Singh@galaxysurfactants.com; Sandeep Kapoor Sandeep.Kapoor@galaxysurfactants.com; Chetan Chandgaonkar Chetan.Chandgaonkar@galaxysurfactants.com
Subject: MDG MM Create Change Request completed

Dear User,
A master data request 7773 has been approved. A Material Master 1012014 ( Benzoic Acid Flakes ) has been created.

  1. Click here-> 7773 http://geccappl.gsl.com:8003/sap/bc/webdynpro/sap/mdg_bs_mat?CREQUEST=000000007773&CRTYPE=ZMATROH&ACTION=CREATE&IS_CREQ_MODE=X&WDCONFIGURATIONID=BS_MAT_INIT_07&SAP-CLIENT=400&SAP-LANGUAGE=EN (New material code - Benzoic acid Flakes) to log into MDG system.

Change Request Details:

Material Type:ROH(Raw materials)

Plant Details:

Plant

Plant Desc

1100

P01

2000

M-3

2200

W-67

Regards,
MDG Team

Note: This is a system generated email,
please do not reply.
Please contact SAP Team if you encounter any technical issues.
“Please note that the information and attachments in this email communication may contain confidential or privileged information and is for the exclusive use of the intended addressee only. Before opening and accessing the attachment,
if any,
please check and scan for virus. If you are not the intended recipient or if you have received this message erroneously,
please delete it from your computer permanently and immediately notify the sender. Any use,
forwarding,
printing,
storing,
disseminating,
distribution or copying of such unintended or erroneously received email communication and its attachments is prohibited.”

“Please note that the information and attachments in this email communication may contain confidential or privileged information and is for the exclusive use of the intended addressee only. Before opening and accessing the attachment,
if any,
please check and scan for virus. If you are not the intended recipient or if you have received this message erroneously,
please delete it from your computer permanently and immediately notify the sender. Any use,
forwarding,
printing,
storing,
disseminating,
distribution or copying of such unintended or erroneously received email communication and its attachments is prohibited.” "

Hi @Ajinya_jorwekar

Please use the below syntax in an assign activity.

- Assign -> Output = String.Join(",", System.Text.RegularExpressions.Regex.Matches(Mail_Body.toString, "(?<=Plant Details:[\s\S]+)(?<!\s\d+\s)\d{4}(?=\s+[A-Z]+)"))

Regards

In other mail case it gives me other 4 digit numbers also but I want only Plant (3500,4800)

Dynamic Mail Body Receives from Get Outlook mail message as per below:

@"From: Swapnil Shewale Swapnil.Shewale@galaxysurfactants.com
Sent: Tuesday,
February 20,
2024 2:51 PM
To: Ravi Sawant ravi.sawant@galaxysurfactants.com
Subject: FW: MDG MM Create Change Request completed

From: Workflow System <SAP_WFRT@GALAXYSURFACTANTS.COM mailto:SAP_WFRT@GALAXYSURFACTANTS.COM >
Sent: Friday,
February 16,
2024 3:40 PM
To: Yogesh Thakur <yogesh.thakur@galaxysurfactants.com mailto:yogesh.thakur@galaxysurfactants.com >; Vijendra Joshi <Vijendra.Joshi@galaxysurfactants.com mailto:Vijendra.Joshi@galaxysurfactants.com >; R.K.Singh <Singh@galaxysurfactants.com mailto:Singh@galaxysurfactants.com >; Swapnil Shewale <Swapnil.Shewale@galaxysurfactants.com mailto:Swapnil.Shewale@galaxysurfactants.com >; Sandeep Kapoor <Sandeep.Kapoor@galaxysurfactants.com mailto:Sandeep.Kapoor@galaxysurfactants.com >
Subject: MDG MM Create Change Request completed

Dear User,
A master data request 7663 has been approved. A Material Master 40210213303323 ( Galsoft EcoCare 145H 200KG 9.4TWTDRUMLP ) has been created.

  1. Click here-> 7663 http://geccappl.gsl.com:8003/sap/bc/webdynpro/sap/mdg_bs_mat?CREQUEST=000000007663&CRTYPE=ZMATFH&ACTION=CREATE&IS_CREQ_MODE=X&WDCONFIGURATIONID=BS_MAT_INIT_07&SAP-CLIENT=400&SAP-LANGUAGE=EN (New Material code create to Galsoft EcoCare 145H 200kg pack) to log into MDG system.

Change Request Details:

Material Type:FERT(Finished Product)

Plant Details:

Plant

Plant Desc

3500

MAERSK WAREHOUSE

4800

URAN WAREHOUSE

Storage Locations:

Plant Code

Storage Locations

Storage Locations Desc

3500

3595

WM Storage Locat

4800

4890

Non-WM Storage L

4800

4895

WM Storage Locat

Warehouse Details:

Warehouse No.

Warehouse Desc

350

Bhiwandi Maersk Warehouse

480

Uran Warehouse

Regards,
MDG Team

Note: This is a system generated email,
please do not reply.
Please contact SAP Team if you encounter any technical issues.
“Please note that the information and attachments in this email communication may contain confidential or privileged information and is for the exclusive use of the intended addressee only. Before opening and accessing the attachment,
if any,
please check and scan for virus. If you are not the intended recipient or if you have received this message erroneously,
please delete it from your computer permanently and immediately notify the sender. Any use,
forwarding,
printing,
storing,
disseminating,
distribution or copying of such unintended or erroneously received email communication and its attachments is prohibited.”

“Please note that the information and attachments in this email communication may contain confidential or privileged information and is for the exclusive use of the intended addressee only. Before opening and accessing the attachment,
if any,
please check and scan for virus. If you are not the intended recipient or if you have received this message erroneously,
please delete it from your computer permanently and immediately notify the sender. Any use,
forwarding,
printing,
storing,
disseminating,
distribution or copying of such unintended or erroneously received email communication and its attachments is prohibited.”

“Please note that the information and attachments in this email communication may contain confidential or privileged information and is for the exclusive use of the intended addressee only. Before opening and accessing the attachment,
if any,
please check and scan for virus. If you are not the intended recipient or if you have received this message erroneously,
please delete it from your computer permanently and immediately notify the sender. Any use,
forwarding,
printing,
storing,
disseminating,
distribution or copying of such unintended or erroneously received email communication and its attachments is prohibited.” "

Hi @Ajinya_jorwekar

Please check with the below regex.

- Assign -> Output = String.Join(",", System.Text.RegularExpressions.Regex.Matches(Mail_Body.toString, "(?<=Plant Details:[\s\S]+)(?<!\s+\d+\s+)\d{4}(?=\s+[A-Z]+)"))

Regards