Back to project page Butler.
The source code is released under:
Apache License
If you think the Android project Butler listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.bingzer.android; //from w w w .ja v a 2 s.c om import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Helpers around email */ public final class Email { ///////////////////////////////////////////////////////////////////////////////// public static boolean validate(CharSequence email) { boolean isValid = false; String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$"; Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(email); if (matcher.matches()) { isValid = true; } return isValid; } ///////////////////////////////////////////////////////////////////////////////// }