Regular expression for Email validation in java


       public boolean validateEmail(String email) {
              if ((email != null)
                           && email.matches("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
                                         + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$")) {
                     return true;
              }
              return false;
       }

Comments

Popular posts from this blog

What is Android ?