Extract Required String from Email Body

Team,
I need to extract Requestor Email id ie daniel.arcaro@fiserv.com from below email body, any suggestions :

Click here to view Task: TASK3089025
The Requested Item is RITM2544177 and the Task is Assigned to group: Card-TechOps-Debit BOS-T1
The following information below is from the Task and Requested Item:
Task Information:
Short description: Debit BOS: BATCH FILE ATTACHED FOR AUTO ADJUST
Description: SQL>
COUNT
545

SQL> SQL>
DB SUM(AMOUNT)


D 122894.71
C 78671.74

Card-TechOps-Debit BOS-T1
Requester Information:
Name: Daniel Arcaro
Email: daniel.arcaro@fiserv.com
Phone: +1 (856) 8436235
Requested Item Information:
Requester Details:
Requested for: Daniel Arcaro
Opened by: Daniel Arcaro
Primary contact: Opened by

Request Details:
Which support team is this for?: Debit
Which group are you requesting?: Debit BOS
What client(s) is this for?: Debit Card Network
What platform is this for?: EPOC
What sub-platform?: PROD
What is the priority?: Medium
Type of Debit request.: Question
Short Description: BATCH FILE ATTACHED FOR AUTO ADJUST
Detailed Description: SQL>
COUNT
41

SQL> SQL>
DB SUM(AMOUNT)


D 682653.71
C 9545.22
Card-TechOps-Debit BOS-T1

SLA duration remaining: 2 Days 23 Hours 59 Minutes

Ref:MSG399659801

Hi,

How about the following pattern?

(?<=Email:\s+).*

 System.Text.RegularExpressions.Regex.Match(yourString,"?<=Email:\s+).*").Value

Regards,

Hi @prerna.gupta

How about the following?

System.Text.RegularExpressions.Regex.Match(YourInputString.Trim,"(?<=Email:\s+)\S.*").ToString

image

Regards
Gokul

Using your Solution i’m getting Output as below where @ is extra:

@"daniel.arcarofiserv.commailto:daniel.arcarofiserv.com
"

Using this solution i’m getting Error
Assign: parsing “?<=Email:\s+).*” - Quantifier {x,y} following nothing.

Hi,

Sorry, it’s my typo. Expression should be the following.

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=Email:\s+).*").Value

Regards,

If you have an @ in the input? @prerna.gupta

I don’t think so it will come while using the expression?

Can you share the screenshot?

Regards
Gokul

image

image

With you r solution as well @ is coming extra

Hi,

As this @ sign is outside of string literal, we can ignore it. (it’s one of C# style string expressions)
Please see the following document section2 in details.

BTW, if you need mail address without mailto: section, the following will work.

 System.Text.RegularExpressions.Regex.Match(yourString,"(?<=Email:\s+)[^<\s]+").Value

Regards,

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