I am trying to build a regex for user input that will handle both: integers and floats in the range of 0 to 999.99. Acceptable values are: 0, 0.00, 10, 10.41, 150, 150.53... etc. The small catch is that the amount of preceding and trailing zeroes should be unlimited, so it would accept 0000153 as well as 153.0000000.
I have managed to build a very similar one, for handling values between 100 to 9999.99 - works perfectly.
(0*(?=[1-9])[1-9]?[0-9]{3}?(\.\d{1})?(\d{1}0*)?)
I've been trying to remodel it, but there is always something wrong with it.
Thank you for your help.