validators:pattern=<somepattern> does not support useful regex patterns
-------------------------------------------------------------------------
Key: TAPESTRY-858
URL: http://issues.apache.org/jira/browse/TAPESTRY-858
Project: Tapestry
Type: Bug
Components: Framework
Versions: 4.0
Environment: All
Reporter: Sean Scott
ValidatorFactoryImpl.constructValidatorList uses a regular expression to
parse the validators configuration string. The configuration string can
contain the type pattern=<some regular expression>. If the regular expression
contains a [ character (like most do) then the validators string is not
processed correctly.
Currently:
private static final String PATTERN =
"^\\s*(\\$?\\w+)\\s*(=\\s*(((?!,|\\[).)*))?";
Perhaps it can be changed so that the regex has start with ^ and end with $ and
thus maybe a PATTERN like
^\s*(\$?\w+)\s*(=(\^.*\$)|(\s*(((?!,|\[).)*)))?
can be used.
To test, try using this value
validators="validators:required,pattern=(0[1-9]|1[012])/(0[1-9]|[12][0-9]|3[01])/(19|20)\d\d"
(mm/dd/yyyy)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]