in reply to Match number >= 0 and <1

Is "0." valid? Is "." valid? I'm assuming the first is allowed, but the second is not: /^(?=0(?!\d)|\.\d)(0?\.?\d*)$/ I believe that works fine. The initial look-ahead ensures we're either going to see 0 that's not followed by a digit or a '.' that IS followed by a digit. The rest of the regex APPEARS to be able to match zero characters, but we know from our look-ahead we'll match AT LEAST a "0" or a ".X".

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart