bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject [22/51] [abbrv] bval git commit: [BVAL-117] Correct email validation regex
Date Fri, 03 Nov 2017 22:27:47 GMT
[BVAL-117] Correct email validation regex



Project: http://git-wip-us.apache.org/repos/asf/bval/repo
Commit: http://git-wip-us.apache.org/repos/asf/bval/commit/e36f14d8
Tree: http://git-wip-us.apache.org/repos/asf/bval/tree/e36f14d8
Diff: http://git-wip-us.apache.org/repos/asf/bval/diff/e36f14d8

Branch: refs/heads/master
Commit: e36f14d880a0565c064fa4df031955d74578228a
Parents: fc8b020
Author: Matt Benson <mbenson@apache.org>
Authored: Thu Oct 20 22:47:06 2016 +0000
Committer: Matt Benson <mbenson@apache.org>
Committed: Thu Oct 20 22:47:06 2016 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/bval/routines/EMailValidationUtils.java  | 2 +-
 .../test/java/org/apache/bval/constraints/EmailValidatorTest.java | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bval/blob/e36f14d8/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java
----------------------------------------------------------------------
diff --git a/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java b/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java
index 0d2ff2f..1158c7f 100644
--- a/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java
+++ b/bval-core/src/main/java/org/apache/bval/routines/EMailValidationUtils.java
@@ -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;

http://git-wip-us.apache.org/repos/asf/bval/blob/e36f14d8/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java b/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java
index 52e994e..76239ad 100644
--- a/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java
+++ b/bval-jsr/src/test/java/org/apache/bval/constraints/EmailValidatorTest.java
@@ -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