I'm trying to check for a double that has a maximum of 13 digits before the decimal point and the decimal point and numbers following it are optional. So the user could write a whole number or a number with decimals.
To start with I had this:
if (check.matches("[0-9](.[0-9]*)?"))
I've been through several pages on Google and haven't had any luck getting it working despite various efforts. My thought was to do it like this but it doesn't work:
[0-9]{1,13}(.[0-9]*)?
How can I do it?