Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- namespace _1021___Extract_Emails
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- string pattern = @"(?<= )[A-Za-z0-9]+([\.|\-]\w*)?[^.-_]@\w+[\.|\-]+\w+[\.]*\w*[\.]*\w*\b";
- Regex regex = new Regex(pattern);
- MatchCollection matc = regex.Matches(input);
- foreach (Match item in matc)
- {
- Console.WriteLine(item.Value);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement