bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1765901 - in /bval/trunk: bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java
Date Thu, 20 Oct 2016 22:47:06 GMT
Author: mbenson
Date: Thu Oct 20 22:47:06 2016
New Revision: 1765901

URL: http://svn.apache.org/viewvc?rev=1765901&view=rev
Log:
[BVAL-117] Correct email validation regex

Modified:
    bval/trunk/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java
    bval/trunk/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java

Modified: bval/trunk/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java
URL: http://svn.apache.org/viewvc/bval/trunk/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java?rev=1765901&r1=1765900&r2=1765901&view=diff
==============================================================================
--- bval/trunk/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java
(original)
+++ bval/trunk/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java
Thu Oct 20 22:47:06 2016
@@ -26,7 +26,7 @@ import java.util.regex.Pattern;
  * Time: 10:40:59<br>
  */
 public class EMailValidationUtils {
-    private static String ATOM = "[^\\x00-\\x1F^\\(^\\)^\\<^\\>^\\@^\\,^\\;^\\:^\\\\^\\\"^\\.^\\[^\\]^\\s]";
+    private static String ATOM = "[^\\x00-\\x1F\\(\\)\\<\\>\\@\\,\\;\\:\\\\\\\"\\.\\[\\]\\s]";
     private static String DOMAIN = "(" + ATOM + "+(\\." + ATOM + "+)*";
     private static String IP_DOMAIN = "\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\]";
     public static final java.util.regex.Pattern DEFAULT_EMAIL_PATTERN;

Modified: bval/trunk/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java
URL: http://svn.apache.org/viewvc/bval/trunk/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java?rev=1765901&r1=1765900&r2=1765901&view=diff
==============================================================================
--- bval/trunk/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java
(original)
+++ bval/trunk/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java
Thu Oct 20 22:47:06 2016
@@ -72,6 +72,9 @@ public class EmailValidatorTest {
 
         customer.setEmailAddress("some.valid-012345@address_at-test.org");
         assertTrue(validator.validate(customer).isEmpty());
+
+        customer.setEmailAddress("permit^circumflex^aka^caret@address_at-test.org");
+        assertTrue(validator.validate(customer).isEmpty());
     }
 
     @Test



Mime
View raw message