CSharp examples for System.Text.RegularExpressions:Match Email
Is Email Address by regex
using System.Text.RegularExpressions; using System.Text; using System.Reflection; using System.Linq; using System.Collections.Generic; using System;/*from ww w. ja v a 2 s .co m*/ public class Main{ public static bool IsEmailAddress(string input) { if (string.IsNullOrEmpty(input)) { return false; } return Regex.IsMatch(input, @"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"); } public static bool IsNullOrEmpty(string value) { if (value == null) { return true; } return value.Trim().Length == 0; } }