//Set the email pattern string
Pattern pPattern =
Pattern.
compile("([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(" +
"([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)");
//Match the given string with the pattern
Matcher mMather = pPattern.
matcher(strEmail
);
return mMather.
matches();