\\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx)$\\bYou can also specify expression, caseSensitive and trim params as a OGNL expression, see the example below.
<!-- Plain Validator Syntax --> <validators> <validator type="email"> <param name="fieldName">myEmail</param> <message>Must provide a valid email</message> </validator> </validators> <!-- Field Validator Syntax --> <field name="myEmail"> <field-validator type="email"> <message>Must provide a valid email</message> </field-validator> </field> <!-- Field Validator Syntax with expressions --> <!-- Only available when used with xml based configuration, if you want to have the same flexibility with annotations use @RegexFieldValidator instead --> <field name="myEmail"> <field-validator type="email"> <param name="regexExpression">${emailPattern}</param> <!-- will be evaluated as: String getEmailPattern() --> <param name="caseSensitiveExpression">${emailCaseSensitive}</param> <!-- will be evaluated as: boolean getEmailCaseSensitive() --> <param name="trimExpression">${trimEmail}</param> <!-- will be evaluated as: boolean getTrimEmail() --> <message>Must provide a valid email</message> </field-validator> </field>@author jhouse @author tm_jee @version $Date$ $Id$
An empty string or a null is always accepted - use the required flag on fields or a separate validator (or override {@link #isValidValue(String)}) to fail on empty values.
@author Vaadin Ltd. @since 5.4This implementation is not guaranteed to catch all possible errors in an email address. For example, an address like nobody@noplace.somedog will pass validator, even though there is no TLD "somedog"
. @version $Revision: 478560 $ $Date: 2006-11-23 13:09:27 +0000 (Thu, 23 Nov 2006) $ @since Validator 1.1This implementation is not guaranteed to catch all possible errors in an email address. For example, an address like nobody@noplace.somedog will pass validator, even though there is no TLD "somedog"
. @version $Revision: 1608584 $ $Date: 2014-07-07 19:54:07 +0000 (Mon, 07 Jul 2014) $ @since Validator 1.4Note: This validator required Java 6, because it uses {@code java.lang.IDN} to support internationalized domain names (IDNs).
@author Emmanuel Bernard @author Hardy Ferentschik
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|