\d{1,10}(?:\.\d{1,3})? Notes: ~ Use \d instead of [0-9] ~ Use ? instead if {0,1} ~ Group the decimal and the following digits so either both or neither must appear. ~ This presumes that you want "123" and "123.1" to be valid, but "123." to be invalid, change the second 1 to a 0 if that's not true. ~ Keep in mind that you need something before and after that expression as well to delimit it. If your numbers were each on a line by themselves, then a ^ on the front and a $ on the end would work. But you need to avoid matching 991111111111.1119 the valid number in the middle of the bigger number there. -Blake