Regex for Email : Regex Email « Regular Expression « C# / CSharp Tutorial






using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
using System.Reflection;

public class MainClass{

   public static void Main(){
        Regex r = new Regex(@"\w+@(\w+\.)+\w+");
        Console.WriteLine(r.IsMatch("j@by.com"));
        Console.WriteLine(r.IsMatch("jn@b.com"));
        Console.WriteLine(r.IsMatch("o47@l.com"));
   }
}
True
True
True








17.3.Regex Email
17.3.1.Regex for Email
17.3.2.Return true if strIn is in valid e-mail format