I'm trying to generate a regular expression with the next pattern. A number, of a maximum of 16 digits, that can have or not a comma inside, never at the beginning, never at the end. I tried this:
^(?:\d+(?:,{1}\d+){1})$
The problem is that I can't count the result of a group {0,16}. This is a list of numbers that should fit the expression:
123,34
1,33333333
1222222233
Example numbers that shouldn't fit:
1111,1111,1111
,11111
11111,
11111111111111111111111111111,111111111111111 (more than 16 characters)