Advertisement
allia

емайл доделать

Feb 16th, 2021
1,462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System;
  2. using System.Text;  
  3. using System.Text.RegularExpressions;
  4.  
  5. class MainClass
  6. {
  7.    public static void Main (string[] args)
  8.   {
  9.     string all_domen = @"(([-A-Za-z0-9]{1,63}\.)+[a-z]{2,4})";
  10.     string mailbox = $@"\w+";
  11.     string pattern = $@"{mailbox}@{all_domen}";
  12.  
  13.     string str;
  14.  
  15.     while((str = Console.ReadLine())!= null)
  16.       foreach (Match match in Regex.Matches(str, pattern))
  17.          Console.WriteLine(match.Value);
  18.   }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement