I need to check a value if it is numeric and optionally contains commas.
I tried
var input=3433;
var pattern=/^[1-9]\d{0,2}(\.\d{3})*(,\d+)?$/;
pattern.test(input);
but it always gave me false;
I don't want to use $.isNumeric as it does not check for commas.
Your sample var input is not matched by your regex because of the dot.
You could do:
This regex will match:
12312341.234123,451234,5671.234,561.234.567,89