Android examples for java.util.regex:Email Pattern
Create regular expression for validating Email
import android.text.TextUtils; import java.math.BigDecimal; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static boolean isEmail(String email) { String check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; Pattern regex = Pattern.compile(check); Matcher matcher = regex.matcher(email); return matcher.matches(); }/* www .j a v a2s . co m*/ }