cancel
Showing results for 
Search instead for 
Did you mean: 

UDF for valid email ID

Former Member
0 Kudos

Hi Experts,

I have an email Id in the source message..

how can i check if it is a valid email address?..any standard functions?

UDF?

Accepted Solutions (1)

Accepted Solutions (1)

former_member187339
Active Contributor
0 Kudos

Hi Ravi,

Yopu need to write your own java code (udf) for this.

Have a look a this program http://www.devx.com/tips/Tip/42339

Regards

Suraj

Answers (3)

Answers (3)

Former Member
0 Kudos

UDF to validate email(with one argument email)


int apos,  dotpos;
apos=email.indexOf("@");
  dotpos=email.lastIndexOf(".");
  if (apos<1||dotpos-apos<2)
    {
return "NotValid";
}
else return "valid";

Former Member
0 Kudos

Hi Teja,

Whatever Suraj and Patrick said that is correct by using java regular expressions we can check the email format but not the email address.

In the regular expressions we have to give some characters & numbers and do the validation if any other character other than what ever we have given comes then it thrown an error, means it is validating the email format (if the email contains '@', '.com', '_', numbers from 0-9 and characters from a-z and A-Z........)

for java code check this links

http://www.zparacha.com/ultimate-java-regular-expression-to-validate-email-address/

http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/

Regards

Ramesh

Former Member
0 Kudos

Hi,

you could do this with regular expressions.

Here you could find a sample code from SUN:

http://java.sun.com/developer/technicalArticles/releases/1.4regex/

Regards

Patrick