I need to get the list of emails from a text string. I have tried several ways and nothing turns out. If anyone of you could help me, I would really appreciate it.
Here is my code:
string patern = @"\[A-Za-z]+@[a-z]+\.[a-z]+\";
string inputText = @"Test1 <[email protected]>, "'Carlos , Tapia'" <[email protected]>, Test2 <[email protected]>"
var matches = Regex.Matches(inputText, patern);
foreach (Match m in matches)
{
Debug.Print(" {0}", m.Value);
}
The exit would be:
Any contribution would be great.