Hello,
This is my update code, please have a look at it, if you think that there is a correction to me made in the code then please guide me with the same.
Code:
Public static boolean isEmailWellFormed(String email){
String in = email;
if (in == null){
System.out.System.out.println("Email address can not be null!");
return false;
}
/ / regex pattern info: http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html
/ / checks for email right format
Pattern Pattern p =.compiles("(\\w +) ((\\.|\\-)\\w +)*@((\\w +\\.)|(\\w +\\-))(\\w +) (\\.\\w +) * ");
Matcher m = p.matcher(in);
if (! m.games()) {
System.out.System.out.println("Email address is not correct!");
return false;
}
return true;
}
Bookmarks