Mail id validation

#1
Hi all,

How to validate mail id based on below conditions :
1. Mail id should not have two times @
2. Mail id should have one .
3. Mail id should have only 3 characters after .
 
#2
You can validate the requirements through a decision-making stage. Here's a solution for the first two conditions:

1. Only one @:
InStr(Right([Mail ID]; Len([Mail ID])-InStr([Mail ID]; "@")); "@")=0

2. A dot after the @:
InStr(Right([Mail ID]; Len([Mail ID])-InStr([Mail ID]; "@")); ".")>0
 
#3
Use this code:

Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
Match match = regex.Match(txtemail); // input mail address
result=match.Success;
 
Top