01.JAVA/Java2010. 9. 27. 16:16
반응형
public class Main {

  public static void main(String[] args) {
    System.out.println("isValid = " + isValidEmailAddress("user@domain.com"));
  }

  static boolean isValidEmailAddress(String email) {
    String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$";

    return email.matches(EMAIL_REGEX);
  }
}
Posted by 1010