I have been trying to create a simple Email validation method, that shows the existence of a username@domainname.com, to no success. I tried this:
public boolean validateEmailAddress(String emailAddress) {
RE pattern = new RE("^[(a-zA-Z-0-9-\\_\\+\\.)]+@[(a-z-A-z)]+\\.[(a-zA-z)]{2,3}$");
return pattern.match(emailAddress);
}
I imported RE from
com.codename1.util.regex.RE
Each time I test it, I get the Error message:
Exception: com.codename1.util.regex.RESyntaxException - Syntax error: Missing operand to closure
What is the best way to achieve this?