In my case, content will come it may contain emailaddress in any of the below format.
1. From : dr-dscsda-ds-info@asdf.com
2. From:sadaedf@sdc.sdfds
3. rom: sdcasdc <information@dsf.net>
4. From: "adads" <adsasd@adsc.cd>
5. From: <customercare@ddsaf.com>
I need to find the one of the above pattern and extract the email address from this
Regex I tried
From\s*:\s*((["|']?)[\w|\s]+\2)?\s*(\<?)([\w]([\w\-\.\+\'\/]*)@([\w\-\.]*)(\.[a-zA-Z]{2,22}(\.[a-zA-Z]{2}){0,2}))(\>?)
All the format matches in my regex. But except 1 and 2, I'll be extract the email address from the regex using group(4).
But in case of 1 and 2, It does not give me full emailaddress.
Please help to alter the regex so that it matches all my case.