I have a regular expression to validate a input value.
At this point I have:
([0-9]{0,3}[.]?)*[0-9]{1,3},[0-9]*|[0-9]
Its working, but now I need to add a validation to see if the value is not 0,00
The input is an amount value.
Possible values:
12,31
1.234,56
1.234.567,89
Not possible values:
0,00
I need this to use in dijit.form.ValidationTextBox .
Something like:
dijit.byId(nameID).regExp = "([0-9]{0,3}[.]?)*[0-9]{1,3},[0-9]*|[0-9]";
I think you have to rethink your regurlar expression completely, because it testes true strings like “1.23.4,56” and “0,”, but I don’t think it’s what you want.
Try something like this:
Test your regular expression with RegExr, but keep in mind that Javascript doesn’t support all the features of the most complete regex engines. In fact, it’s quite poor.
Some more notes:
[.]to match a dot. It’s slow. Just escape the dot:\.\dinstead of[0-9]for short, and you can use it in square brackets too:[a-f\d\-]for all hexadecimal integer chars.