Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- namespace avstn.mail
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Title = "Email validtor";
- string pattern = @"^([a-z0-9\.\-]{3,20})\@([a-z]{1,10})\.([a-z]{2,10})$";
- Regex reg = new Regex(pattern, RegexOptions.ExplicitCapture);
- string email;
- do
- {
- email = Console.ReadLine();
- if (email == string.Empty)
- continue;
- Console.WriteLine(string.Format("Validaty check: {0} \n\n", reg.IsMatch(email)));
- }
- while (email != "/q");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement