As the title of the question, I need to validate regex using the following values:
(Maximum 2 decimal places, and 9 integers) with an optional percent symbol.
Valid:
10%
0%
1111111.12%
15.2%
10
2.3
Invalid:
.%
12.%
.02%
%
123456789123.123
I tryed:
^[0-9]{0,9}([\.][0-9]{0,2})\d[\%]{0,1}?$
But It does not work as I want.
try this
I tested over rubular and it is ok for your set of example.