How many es can you find in:
Q: extract an email address from a text in apex code, i would like to extract an email address alone from a text like below.
Note: The domain name wont be the same.
please share if you have any idea?
Example Text:
Delivery has failed for the below recipient
sa1122112211@domain.co.uk
A problem occurred during the delivery of this message to this e-mail address. Try sending this message again. If the problem continues, please contact your helpdesk.

A: You can try with Regex. You need to use find() and group(). As your text is not static so I used some junk text. Sample code for your reference.
String s = agfawig test@Test.com klaho;hfwaojfoiskfhnkh enesr eknnw rendafn owen;
    Matcher m = Pattern.compile([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+).matcher(s);
    while (m.find()) {
        System.debug(m.group());
    }


A: //string EmailBody;// get the Email body from from the Mail;

This piece of the code only work for the above email.
string EmailBody = Delivery has failed for the below recipient +
                    sa1122112211@domain.co.uk +
                    A problem occurred during the delivery of this message to this e-mail address. Try sending this message again. If the problem continues, please contact your helpdesk.;
Pattern p = Pattern.compile((?<=below recipient)(.*)(?=A problem));
Matcher m = p.matcher(EmailBody);
if (m.find()) 
{
   system.debug(m.group(1)); 
}

Try to run the above code in anonymous window 

user
The text includes 137 "e"s in total.
assistant