Lucas Dayries Lucas Dayries - 6 months ago 52
Java Question

Java regexp for textfield matching

So I'm working with Java regexp and I'm having a bit of troubles to create one. I must get a regexp that matches numbers between 0.0 and 359.9 with always exactly one decimal, which isn't super complicated, but I'm doing a regexp for a textfield meaning that if the expression doesn't match at ever character, I can't type further.

What it means is that basically 3 35 359 359. 359.9 must all match for me to type in the field.

I've been trying stuff around with

but that doesn't match every step of the way and
allows it to start with a zero. I can't get really further with what I know of regexp and I would appreciate any help.


Try this: