commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bspeak...@apache.org
Subject svn commit: r588369 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
Date Thu, 25 Oct 2007 21:47:53 GMT
Author: bspeakmon
Date: Thu Oct 25 14:47:52 2007
New Revision: 588369

URL: http://svn.apache.org/viewvc?rev=588369&view=rev
Log:
- cleanup and simplify java 1.4 regexs

Modified:
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java?rev=588369&r1=588368&r2=588369&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
Thu Oct 25 14:47:52 2007
@@ -49,7 +49,7 @@
     private static final String WORD = "((" + VALID_CHARS + "|')+|" + QUOTED_USER + ")";
 
     // Each pattern must be surrounded by /
-    private static final String LEGAL_ASCII_PATTERN = "^[\\0000-\\0177]+$";
+    private static final String LEGAL_ASCII_PATTERN = "^\\p{ASCII}+$";
     private static final String EMAIL_PATTERN = "^(.+)@(.+)$";
     private static final String IP_DOMAIN_PATTERN = "^\\[(.*)\\]$";
     private static final String TLD_PATTERN = "/^([a-zA-Z]+)$/";
@@ -91,8 +91,8 @@
         }
 
         Pattern matchAsciiPattern = Pattern.compile(LEGAL_ASCII_PATTERN);
-        Matcher matcher = matchAsciiPattern.matcher(email);
-        if (!matcher.matches()) {
+        Matcher asciiMatcher = matchAsciiPattern.matcher(email);
+        if (!asciiMatcher.matches()) {
             return false;
         }
 



Mime
View raw message