T
Tek Boy
I have a regular expression that makes sure an input string is a
decimal value, the values of which are limited to 0.50 increments.
For example, 10.00, 31.5 and 0.5000000 would all be valid.
^[0-9]{1,}(\.[0]{0,}|\.5[0]{0,})?$
I had initially planned on using lookaheads [e.g. x(?=y)] to make sure
that a decimal should only be recognized if a value comes after it. I
was trying to do something like this (initially just to match a
decimal value with 2 zeros after it):
^[0-9]{1,}\.(?=00)$
But even that didn't work. What am I missing? Thanks in
advance..........
-=Tek Boy=-
decimal value, the values of which are limited to 0.50 increments.
For example, 10.00, 31.5 and 0.5000000 would all be valid.
^[0-9]{1,}(\.[0]{0,}|\.5[0]{0,})?$
I had initially planned on using lookaheads [e.g. x(?=y)] to make sure
that a decimal should only be recognized if a value comes after it. I
was trying to do something like this (initially just to match a
decimal value with 2 zeros after it):
^[0-9]{1,}\.(?=00)$
But even that didn't work. What am I missing? Thanks in
advance..........
-=Tek Boy=-