^(?=.{1,15}$)\d+(,\d+)?$
^ beginning of line(?=.{1,15}$) a positive forecast to provide a full line length between 1 and 15\d+ one or more digits.(,\d+)?followed by a comma and other numbers$ end of line (not really required as we already checked it in lookahead).
You may need to hide the backslash for Java: ^(?=.{1,15}$)\\d+(,\\d+)?$
update: , \b (^ $).
\b(?=[\d,]{1,15}\b)\d+(,\d+)?\b
java:
"\\b(?=[\\d,]{1,15}\\b)\\d+(,\\d+)?\\b"
:
"\\b(?=[0-9,]{1,15}\\b)[0-9]+(,[0-9]+)?\\b"