I have a text box where users can enter only numbers separated by commas.
For instance users can enter only 10,11,13,20 and so on. but they shouldn enter as 010,011,00013,020.
I tried this one but to no avail
newValue.replace(/[^\d,]+/g, '').replace(/^0+/, '').replace(/,,/g, ',');
This restricts only the starting zero,limits the space and numbers only but in-between zeros are not restricted.
Is there any regular expression to replace all the leading zeros in the string above to make it as 10,11,13,20 allowing only one comma in between