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

Top 5 Contributors of the Month
Sandeep Singh

Home >> Code Snippets >> Regular Expressions >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Regular Expression in C# Windows

Posted By:Suderson Sarathy       Posted Date: November 22, 2010    Points: 15    Category: Regular Expressions    URL: http://www.dotnetspark.com  

Regular Expression in C# for Windows Application

This code will have the regular experssion for the emails. Only if the expression matches, it will return true. Include the namespace "using System.Text.RegularExpressions" for it to work
string reg = "xyz@gmail.com"
string reg = @"^((([\w]+\.[\w]+)+)|([\w]+))@(([\w]+\.)+)([A-Za-z]{2,3})$";
if (Regex.IsMatch(Value, reg))
  // code here


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

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