Csharp/CSharp Tutorial/Regular Expression/Regex Email
Regex for Email
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.ru"));
Console.WriteLine(r.IsMatch("jn@b.ru"));
Console.WriteLine(r.IsMatch("o47@l.ru"));
}
}
True True True