Java Email Validate isEmail(String input)

Here you can find the source of isEmail(String input)

Description

is Email

License

Apache License

Declaration

public static boolean isEmail(String input) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.regex.*;

public class Main {

    public static boolean isEmail(String input) {
        return tstPattern("^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$", input);
    }/*from   w ww .jav  a  2s.co  m*/

    public static boolean tstPattern(String regex, String input) {
        Pattern p = Pattern.compile(regex);
        return p.matcher(input).matches();
    }
}

Related

  1. isEmail(String email)
  2. isEmail(String email)
  3. isEmail(String email)
  4. isEmail(String email)
  5. isEmail(String emailAddress)
  6. isEmail(String msg)
  7. isEmail(String s)
  8. isEmail(String str)
  9. isEmail(String str)