Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- string patternText = @"[A-Za-z.\d]+\@[A-Za-z]+\.[A-Za-z.]*(?=.|\s)";
- string result = string.Empty;
- Regex regexEmail = new Regex(patternText);
- foreach (var item in regexEmail.Matches(input))
- {
- Console.WriteLine(item);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment