commons-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=588386&view=rev
Log:
- VALIDATOR-191: incrementally replace oro with java.util.regex

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=588386&r1=588385&r2=588386&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 16:21:47 2007
@@ -52,7 +52,7 @@
     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]+)$/";
+    private static final String TLD_PATTERN = "^\\p{Alpha}+$";
 
     private static final String USER_PATTERN = "/^\\s*" + WORD + "(\\." + WORD + ")*$/";
     private static final String DOMAIN_PATTERN = "/^" + ATOM + "(\\." + ATOM + ")*\\s*$/";
@@ -200,8 +200,7 @@
         // list
         String tld = domainSegment[len - 1];
         if (tld.length() > 1) {
-            Perl5Util matchTldPat = new Perl5Util();
-            if (!matchTldPat.match(TLD_PATTERN, tld)) {
+            if (!Pattern.matches(TLD_PATTERN, tld)) {
                 return false;
             }
         } else {



Mime
View raw message