import java.io.PrintStream;
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()
{
 this.pattern = Pattern.compile("^([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 boolean validate(String paramString)
{
this.matcher = this.pattern.matcher(paramString);
    
System.out.println("Email " + paramString + " --> " + this.matcher.find());
    
return this.matcher.matches();
}
}


