hi everyone.
I would like to enter multiple email addresses in a single text-field, separate them with a semi-colon, and still be able to validate the input.
For only one email address, I could succeed fine (see sample code below).
Can please anyone tell how do I validate multiple email addresses? And how to semi-colon delimiter them (suppose the user uses a colon)
boolean isValidEmail = false;
String validExpression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";
Pattern compare = Pattern.compile(validExpression, Pattern.CASE_INSENSITIVE);
Matcher matcher = compare.matcher(getEmailAddressTextField().getText());
if(matcher.matches()) {
isValidEmail = true;
getEmailAddressTextField().setText(getEmailAddressTextField().getText().concat(";"));
}
else
//error-code goes here
Thanks