You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by an...@apache.org on 2007/10/27 00:34:32 UTC
svn commit: r588785 - in /tapestry/tapestry4/trunk/tapestry-framework/src:
java/org/apache/tapestry/form/validator/Email.java
test/org/apache/tapestry/form/validator/TestEmail.java
Author: andyhot
Date: Fri Oct 26 15:34:28 2007
New Revision: 588785
URL: http://svn.apache.org/viewvc?rev=588785&view=rev
Log:
TAPESTRY-1857: Another round of tests + better regexp
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/validator/Email.java
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/validator/TestEmail.java
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/validator/Email.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/validator/Email.java?rev=588785&r1=588784&r2=588785&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/validator/Email.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/validator/Email.java Fri Oct 26 15:34:28 2007
@@ -47,7 +47,7 @@
+ "re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sk|sl|sm|sn|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|"
+ "tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw";
public static final String DOMAIN_PATTERN = "([0-9a-z]([-0-9a-z]{0,61}[0-9a-z])?\\.)+" + "(" + TLD_PATTERN + ")";
- public static final String USERNAME_PATTERN = "([\\\\da-z]+[-._+&'])*[\\\\da-z]+";
+ public static final String USERNAME_PATTERN = "([-/!\\#$*?=_+&'\\da-z]+[.])*[-/!\\#$*?=_+&'\\da-z]+";
public static final String PATTERN = "^(?i)"+ USERNAME_PATTERN + "@" + "(" + DOMAIN_PATTERN + ")$";
// TODO: Possible thread safety issue if the validator
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/validator/TestEmail.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/validator/TestEmail.java?rev=588785&r1=588784&r2=588785&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/validator/TestEmail.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/validator/TestEmail.java Fri Oct 26 15:34:28 2007
@@ -173,6 +173,8 @@
{"J@A.oRg"},
{"foo@example-bar.domain.com"},
{"FOO@EXample-bAr.domain.com"},
+ {"_foo@example.com"},
+ {"$user+mailbox_@example-domain.com"},
};
}
@@ -184,6 +186,8 @@
{"foooooooooooooooooooooooooooo"},
{"LASKFODSKFO@$#)DJMZCV)TQKALAD"},
{""},
+ {"aa@foooooooooooooooooooooooooooooooooooooooooooooooooooooooo"},
+ {"aa@.foooooooooooooooooooooooooooooooooooooooooooooooooooooooo"},
};
}
}