Fórum

How to update the regex for email address validation?

thumbnail
Anil T, modificado 9 Anos atrás.

How to update the regex for email address validation?

Expert Postagens: 313 Data de Entrada: 14/01/12 Postagens Recentes
HI,

We have to update the default regex for user email address validation. So anyone know about it? Could you please update the details with this link.

Thanks,
Anil T
thumbnail
Sandeep Nair, modificado 9 Anos atrás.

RE: How to update the regex for email address validation?

Liferay Legend Postagens: 1744 Data de Entrada: 06/11/08 Postagens Recentes
Hi,

By default liferay uses DefaultEmailAddressValidator class to validate the user email address which is set in portal.properties

users.email.address.validator=com.liferay.portal.security.auth.DefaultEmailAddressValidator

You can create a hook to modify the property to point to your custom email validator.

Regards,
Sandeep
thumbnail
Anil T, modificado 9 Anos atrás.

RE: How to update the regex for email address validation?

Expert Postagens: 313 Data de Entrada: 14/01/12 Postagens Recentes
Thanks
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: How to update the regex for email address validation?

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
It should be noted that with today's "anything goes" domain names, you can only really be sure you have an email address if there are chars before an @ sign and at least one period after @ sign (but not next to it), plus there are some invalid chars (such as the comma).

You used to be able to count on having .gov, .biz, .com, .edu and the like, plus some country codes. But these days you can get some that end with practically anything.
thumbnail
Anil T, modificado 8 Anos atrás.

RE: How to update the regex for email address validation?

Expert Postagens: 313 Data de Entrada: 14/01/12 Postagens Recentes
Thanks for your suggestions David. I too got the same idea and implemented code which has @ and after that symbol it should have one .(dot) symbol.

Thanks,
Anil T