Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Numerics;
- using System.Text.RegularExpressions;
- namespace C_
- {
- class Program
- {
- static void Main(string[] args)
- {
- var input = Console.ReadLine();
- string pattern = @"(^|(?<=\s))([a-zA-Z0-9]+)(\.|-|_)?([a-zA-Z0-9]+)@([a-zA-Z]+.)?([a-zA-Z]+.)?([a-zA-Z0-9]+\.[a-zA-Z]+)";
- MatchCollection matches = Regex.Matches(input, pattern);
- foreach (Match item in matches)
- {
- Console.WriteLine(item.Value);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment