You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2008/02/06 22:59:07 UTC
[jira] Commented: (TAPESTRY-2127) Limitations of the regexp
validator prevents email validation
[ https://issues.apache.org/jira/browse/TAPESTRY-2127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12566365#action_12566365 ]
Howard M. Lewis Ship commented on TAPESTRY-2127:
------------------------------------------------
Regular expressions are not meant to go inline, they are too complicated.
See nightly docs for a correct approach: http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/TextField.html
> Limitations of the regexp validator prevents email validation
> -------------------------------------------------------------
>
> Key: TAPESTRY-2127
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2127
> Project: Tapestry
> Issue Type: Bug
> Components: Framework
> Affects Versions: 5.0.9
> Reporter: Renat Zubairov
> Attachments: Picture 1.png
>
>
> I'm using regexp validation constraint to enable email validation, however since regular expresion may contain "," regexp parsing failing with exception
> My regexp annotation:
> @Validate("required,regexp=([A-Za-z0-9]+[._-]*)+[A-Za-z0-9]+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2,6}")
> public String getEmail() {
> return email;
> }
> Exception is:
> Caused by: java.util.regex.PatternSyntaxException: Unclosed counted closure near index 62
> ([A-Za-z0-9]+[._-]*)+[A-Za-z0-9]+@([A-Za-z0-9-]+\.)+[A-Za-z]{2
> ^
> at java.util.regex.Pattern.error(Pattern.java:1650)
> at java.util.regex.Pattern.closure(Pattern.java:2690)
> at java.util.regex.Pattern.sequence(Pattern.java:1798)
> at java.util.regex.Pattern.expr(Pattern.java:1687)
> at java.util.regex.Pattern.compile(Pattern.java:1397)
> at java.util.regex.Pattern.<init>(Pattern.java:1124)
> at java.util.regex.Pattern.compile(Pattern.java:817)
> at org.apache.tapestry.services.TapestryModule$9.coerce(TapestryModule.java:639)
> at org.apache.tapestry.services.TapestryModule$9.coerce(TapestryModule.java:637)
> at org.apache.tapestry.ioc.services.CoercionTuple$CoercionWrapper.coerce(CoercionTuple.java:53)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org