Quantcast
Channel: Regular expression in struts - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Regular expression in struts

$
0
0

I am validating the decimal places with precision (5,2) which can have negative numbers using regular expresion in struts.When I try to run this ^[-+]?[0-9]{1,3}+(\.[0-9]{1,2})$in java it is working fine. But, the same expression in struts is throwing below error.

org.apache.struts.validator.FieldChecks processFailure mask validation failed for property inputCost: org.apache.oro.text.MalformedCachePatternException: Invalid expression: ^[-+]?[0-9]{1,3}+(\.[0-9]{1,2})$Nested repetitions *?+ in expression

Here is the code snippet of validation.xml.

<field property="inputCost" depends="double,mask"><arg position="0"  key="label.inputCost"/><msg name="mask" key="label.inputCost.mask"/><var><var-name>mask</var-name><var-value>^[-+]?[0-9]{1,3}+(\.[0-9]{1,2})$</var-value></var></field>

Any inputs are greatly appreciated.


Viewing all articles
Browse latest Browse all 2

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>