static boolean validateEmail(str _email)
{
str emailAddressFilter = @"^[^@]+@[^@]+\.[^@]+$";
System.Text.RegularExpressions.Regex regEx;
System.Text.RegularExpressions.Match regMatch;
str email;
List emailAddresses;
ListEnumerator enum;
boolean retVal;
regEx = new System.Text.RegularExpressions.Regex(emailAddressFilter);
emailAddresses = SysEmailDistributor::splitEmail(_email);
enum = emailAddresses.getEnumerator();
while(enum.moveNext())
{
email = enum.current();
if (email)
{
regMatch = regEx.Match(email);
retVal = regMatch.get_Success();
}
else
retVal = false;
if(!retVal)
break;
}
return retVal;
}
{
str emailAddressFilter = @"^[^@]+@[^@]+\.[^@]+$";
System.Text.RegularExpressions.Regex regEx;
System.Text.RegularExpressions.Match regMatch;
str email;
List emailAddresses;
ListEnumerator enum;
boolean retVal;
regEx = new System.Text.RegularExpressions.Regex(emailAddressFilter);
emailAddresses = SysEmailDistributor::splitEmail(_email);
enum = emailAddresses.getEnumerator();
while(enum.moveNext())
{
email = enum.current();
if (email)
{
regMatch = regEx.Match(email);
retVal = regMatch.get_Success();
}
else
retVal = false;
if(!retVal)
break;
}
return retVal;
}
No comments:
Post a Comment