import java.util.regex.Matcher;
import java.util.regex.Pattern;

class EmailValidator{
	
    private Pattern pattern;
    private Matcher matcher;
 
    private static final String EMAIL_PATTERN = "^([0-9a-zA-Z]([_.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+([a-zA-Z]{2,9}.)+[a-zA-Z]{2,3})$";

    public EmailValidator(){
	  pattern = Pattern.compile(EMAIL_PATTERN);
    }
	  
   /**
    * Validate email address with regular expression
    * @param email email address for validation
    * @return true valid email address, false invalid email address
    */
    public boolean validate(final String email){		  
	  matcher = pattern.matcher(email);

	  System.out.println("Email "+ email + " --> " + matcher.find());
	  
	  return matcher.matches();	    	    
    }
	
}

public class RegularExpressionsEmail extends Object {
	public static void main(String[] args) {
        EmailValidator emailValidator=new EmailValidator();
		emailValidator.validate("user@domain.com");
		emailValidator.validate("user@com");
		emailValidator.validate("my_email");
		emailValidator.validate("user@");
		emailValidator.validate("@domain");
		emailValidator.validate("@");
	}
}