but I came up with this rather convoluted expression:
[0*.[[00[1-9]]|[0[1-9]0?]|[[1-9]0?0?]]]|[0*[1-9]+.[[[0-9][0-9][0-9]]|[
[0-9][0-9]]|[0-9]]]|[0*[1-9].?]
unfortunately, it doesn't work in my test.. but the OR code "|" is known to work differently in different implementations.
Here's a breakdown of my expression - I'd love some feedback from more experienced regexers!
[0*. -- zero or more zeros, followed by a decimal point, followed by...
[
[00[1-9]] -- zero, zero and another digit
| -- or
[0[1-9]0?] -- zero, another digit, and an optional zero
| -- or
[[1-9]0?0?] -- a non-zero, followed by up to 2 optional zeros
]
]
| -- OR
[0*[1-9]+. -- zero or more zeros, 1 or more non-zeros, a decimal and ...
[
[[0-9][0-9][0-9]] -- 3 digits
| -- or
[[0-9][0-9]] -- 2 digits
| -- or
[0-9] -- 1 digit
]
]
| -- OR
[0*[1-9].?] -- zero or more zeros, a non-zero digit, and an optional decimal
I think my problem is the way I use the brackets to define the scope of the ORs? |