Created
June 29, 2017 02:41
-
-
Save brownsoo/b1cdee0551911f39802e57941a661160 to your computer and use it in GitHub Desktop.
e-mail regular expression (java)
This file contains hidden or 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 testEmailFormat(String text) { | |
if (TextUtils.isEmpty(text)) return false; | |
Pattern pattern = Pattern.compile("^(([^<>()\\[\\]\\\\.,;:\\s@\"]" + | |
"+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(.+))" + | |
"@" + | |
"((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])" + | |
"|(([a-zA-Z-0-9]+\\.)+[a-zA-Z]{2,}))$"); | |
return pattern.matcher(text).matches(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment