Getting Started with Adobe After Effects - Part 6: Motion Blur

Upload Image Close it
Select File

A Place to share c#.Net script which are useful to developers


C#.NET Scripts

Validating an email address using regular expressions in

Mar 16 2012 12:00AM by Kirti M.Darji   

This script demonstrates how to validate an email address using a Regular Expression in C#

use following function to validate email address

         /// <summary>
        /// Check Email is valid or not using Regular expression
        /// </summary>
        /// <param name="Email"></param>
        /// <returns></returns>
        private static bool IsValidEmail(string Email)
            string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
                @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
            System.Text.RegularExpressions.Regex regx = new System.Text.RegularExpressions.Regex(strRegex);
            return regx.IsMatch(Email) ? true : false;


Kirti M.Darji
10 · 16% · 5011



  • I see this all too often in email validation.

    You're not matching on (at least) + in the username.

    For instance: & are valid email addresses that gmail (at least) will automatically map to You can then use this for automatic filters on the gmail side.

    commented on May 21 2012 9:50AM
    2916 · 0% · 3
  • What we use is:


    It covers more than 98% of the eMail addresses we get. Note that we're using word not literal alphanumeric. Also, we're checking it as case insensitive to take care of the people that don't know that all eMail addresses are currently lower case. The length restriction is because of our database. We can't handle the longer addresses.

    commented on Jul 5 2012 12:10PM
    Dave Vroman
    130 · 1% · 401
  • All that's understandable. This wasn't targeted specifically at you, but generally across the web, if an email address is being parsed for invalid characters, almost all of the time a '+' will invalidate it. I'm just suggesting that it should not be. I ran this validation against an address with one in it and it failed, and since this went out in a newsletter I wanted to point that out. :)

    commented on Jul 5 2012 12:41PM
    2916 · 0% · 3

Your Comment

Sign Up or Login to post a comment.

"Validating an email address using regular expressions in" rated 5 out of 5 by 9 readers
Validating an email address using regular expressions in , 5.0 out of 5 based on 9 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]