Outputting a string from a file

How do I output emails (Only emails) from a file that contains multiple text? I understand how to open a file and read its contents but what conditions do i use to extract specific data? Do i use ASCII code for @ to single out all the emails? If so, how would i write the code for this?
Can we see example of text file you are looking at?

Check this link out too
http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address

See this link on above page a fully RFC‑822–compliant regex.

Last edited on
https://www.facebook.com/download/1009250055805495/WP_20151204_004.jpg
This is the question. Thank you for taking a look at this. i considered using keyascii but i pretty much got lost after that.
Link does not render into a photo.
" From: sharon@marzipan.edu
Date. Wed, 13 Aug 2003 17:12:33 EDT
Subject: Re: hi
To: john@meringue.com
John,
Dave's email is dave_smith@icing.org.

ttyl,

sharon
"
This is the text. Sorry for the delay. I want to extract the emails from this file and output them in another file, like the following:

"
sharon@marzipan.edu
john@meringue.com
dave_smith@icing.org
"
hypothetical approach in "understandable words" could be something like:

1
2
3
4
5
6
7
8
9
ifstream file;
file.open("file_name.txt");
next_line:
string foo = file.getline();
if(foo.find("To:"))
{
     // get iterator to email
     // save email
}else goto next_line;




Topic archived. No new replies allowed.