I would like to have a regular expression that can work in a simple calculator:
Right now I have: this.field.value.match(/\./))
My problem is I can only insert one decimal at a time:
eg:
2.5 + 2 OR
3 + 3.55
I would like the ability to have the option of adding 2.5 + 2.5. The point is, I’m trying to prevent someone from typing 2.5.5.5 + 5
Try this
Matches
and so on.
Doesn’t match
and so on…
Also matches whitespace between + sign and on beginning and end of input.