I'm trying to create a regular expression to check to see if a valid email address has been entered. There is something wrong with my regular expression. Here is the source code I'm using:
if (!Pattern.matches("^[\\w-\\+]+(\\.[\\w]+)*@[\\w-]+(\\.[\\w]+)*(\\.[a-z]{2,})$", s)) {
et.setError("Enter a valid Email Address");
}
What am I doing wrong?