Created
May 13, 2015 13:49
-
-
Save aanguelov/691ae4a1788507de76d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
namespace ExtractEmails | |
{ | |
class ExtractEmails | |
{ | |
static void Main() | |
{ | |
string text = Console.ReadLine(); | |
string pattern = @"([\w.-]+@[\w.-]+)"; | |
MatchCollection matches = Regex.Matches(text, pattern); | |
foreach (var match in matches) | |
{ | |
Console.WriteLine(match); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment