Android examples for java.util.regex:Email Pattern
Check if string is Email using Regex
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static boolean isEmail(String text) { String reg = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; Pattern regex = Pattern.compile(reg); Matcher matcher = regex.matcher(text); return matcher.matches(); }/*from w w w . ja va 2 s. co m*/ }