on 09-10-2009 11:52 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.