I have looked through several discussion and I am not seeing any helpful answers. I think my regex should be working. I have tested it http://regexr.com/ and http://www.regexplanet.com/advanced/java/index.html
It should be working. I am working on a simple validator POJO that validates strings before setting member variables.
private static final String emailReg = "(.+(@).\\w+\\..\\w+)";
private final Pattern emailPattern = Pattern.compile(emailReg);
And a method that gets called:
public boolean validateEmail( String Email ){
Matcher m = emailPattern.matcher(Email);
return m.matches();
}
This always returns false. The value passed can be any@any.any, but it always returns false. I am not at this point concerned about 'valid' emails, I just need to know if the regex string is properly assembled. From the tutorial pages for building regex'es it appears it is, but my program thinks otherwise.