.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Regulare Expression to validate email

Posted By: Deco     Posted Date: October 25, 2010    Points:2   Category :C#
I need to validate the emailid using regulare expression.
It should support only the domain TCS.com

Valid one:


Invalid One:


Please get me the regular expression for my requirement.

Author: Dhiraj Ranka             
Posted Date: October 26, 2010     Points: 5   

Try this in your code


Hope this helps

Hope this helps.

Thanks & Regards,
Dhiraj Ranka
http://www.twitter.com/dhirajranka | http://www.dhirajranka.com
Author: Don             
Posted Date: January 11, 2011     Points: 5   

public static bool isValidEmail(string inputEmail)
string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
@"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
Regex re = new Regex(strRegex);
if (re.IsMatch(inputEmail))
return (true);
return (false);

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend