I have some code:
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
private boolean validateEmail(...)
Pattern p = Pattern.compile("^((?:(?:(?:[a-zA-Z0-9][\\.\\-\\+_]?)*)[a-zA-Z0-9])+)\\@((?:(?:(?:[a-zA-Z0-9][\\.\\-_]?){0,62})[a-zA-Z0-9])+)\\.([a-zA-Z0-9]{2,6})$");
Matcher m = p.matcher(fieldValue);
boolean matches = m.matches();
if (!matches) {
// show not valid msg...
}
return matches;
}
What do ^((?:(?:(?:
and ((?:(?:(?:
mean in that pattern?
The ^
character mean negation (all without) but other characters?