Thursday, 22 August 2013

regex for validation of positve numbers including zeros and 2 places after decimal in java?

regex for validation of positve numbers including zeros and 2 places after
decimal in java?

precode(^\d{1,15}(\.\d{1,2})?$) /code/pre pThis is the regex i'm trying to
use but java gives syntax error./p
precode^(?!(?:0|0\.0|0\.00)$)[+]?\d+(\.\d|\.\d[0-9])?$ /code/pre pThis one
works well for numbers like 00.00, 124.03, 0.13 but not for 0.0 and 0./p
pplease modify the regex so that it accepts the following kind of numbers
:/p precode123456.00, 12415366.88, 0.23, 0, 0.00, 0.0, 432547, /code/pre
pi.e. only postive numbers which include zero and upto 2 places after
decimal/p

No comments:

Post a Comment