using System;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
Console.WriteLine("Enter your email id");
string email = Console.ReadLine();
string regExpEmail= @"^((([\w]+\.[\w]+)+)|([\w]+))@(([\w]+\.)+)([A-Za-z]{1,3})$";
if (Regex.IsMatch(email, regExpEmail))
{
Console.WriteLine("Email in Correct format");
}
else
{
Console.WriteLine("Invalid Email format");
}
}
}
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
Console.WriteLine("Enter your email id");
string email = Console.ReadLine();
string regExpEmail= @"^((([\w]+\.[\w]+)+)|([\w]+))@(([\w]+\.)+)([A-Za-z]{1,3})$";
if (Regex.IsMatch(email, regExpEmail))
{
Console.WriteLine("Email in Correct format");
}
else
{
Console.WriteLine("Invalid Email format");
}
}
}
No comments:
Post a Comment