Created
November 18, 2015 19:55
-
-
Save sivajankan/dcb27e3f0dc9678af6fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean is_valid_email(String email) { | |
String email_pattern = "[^\\s]+@[^\\s]+.[^\\s]+"; | |
java.util.regex.Pattern r = java.util.regex.Pattern.compile(email_pattern); | |
try { | |
java.util.regex.Matcher m = r.matcher(email); | |
return m.matches(); | |
} catch (java.lang.NullPointerException e) { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment