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
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]