I am trying to match regex decimal floating point numbers. There may or may not be a number before the decimal, and the decimal may or may not be, and if it is present, it may or may not have digits after it. (Invalid +/- or final "E123" master for this application). I wrote this regular expression:
/^([\d]*)(\.([\d]*))?$/
Which correctly matches the following:
1 1. 1.23 .23
However, this also corresponds to an empty string or only a decimal point string that I don't want.
I am currently checking after starting a regular expression that $ 1 or $ 3 has a length greater than 0. If not, this is not true. Is there a way I can do this directly in regex?
syntax regex
Kip
source share