Hi Syncopers,

I'm currently using Syncope 1.0.6 and I've just try to use an "email" attribute 
of type string with validator class 
"org.apache.syncope.core.persistence.validation.attrvalue.EmailAddressValidator".
I set email attribute to value "[email protected]" but I received 
"Error:{[InvalidValues [email: [email protected]]], }"
I think that current email validator regular expression is a bit restrictive:

private static final Pattern EMAIL_PATTERN = 
Pattern.compile("^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$", 
Pattern.CASE_INSENSITIVE);

I'd like to suggest an improvment with something like this [1]

private static final Pattern EMAIL_PATTERN = 
Pattern.compile("^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$",
 Pattern.CASE_INSENSITIVE);

WDYT?

Best regards.
Riccardo.

[1] ref: http://www.regular-expressions.info/email.html

Reply via email to