.Net Interview Questions and Answers

Search:

Write a simple regex for email validation? (C# interview questions with answers)

By : Shiv Prasad Koirala | Mar 24th, 2014 | Views : 3189 | Comments : 0 Bookmark and Share

Before reading the interview answer , please go through this regex video to understand fundamentals of regex with c#



Email validation can be divided in to three part the first is email user name , domain name and the domain extension.


Step 1(Email user name):- Email user name can start with alphanumeric with minimum 1 character and maximum 10 character. , followed by at the rate (@).


^[a-zA-Z0-9]1,10}@


Step 2 ( Domain name) :-The domain name after the @ can be alphanumeric with minimum 1 character and maximum 10 character , followed by a "."


[a-zA-Z]1,10}.


Step 3 ( Domain extension):-Finally should end with .com or .org


.(com|org)$


The final full email regex validation is below.


^[a-zA-Z0-9]1,10}@[a-zA-Z]1,10}.(com|org)$


Please visit www.questpond.com for 600 c# interview questions and answers videos.

 
Rate this Article :
1 Star
2 Stars
3 Stars
4 Stars
5 Stars
1 1 1 2 1
 
 
 
 

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

Article Categories

Learn in Hindi