I have the following regular expression:
^[-+]?[\d{0,3},?\d{3}]*\.?\d+$
I am trying to support numbers of the following formats:
- 1
- -1
- -1.00
- 100,000
I am not concerned about scientific notation but my users may or may not enter in commas. The problem I am having is that the expression is matching:
- 100,
- 100,00
How can I have the expression indicate that if there is a comma then there must be three characters after it.