I have a regex
, which is: /[0-9]+(,[0-9]+)*/
.
It accepts only numbers, separated by a comma. For instance:
1,2,3,4 = good
,1,2,3,4 = bad
1,2,3,4, = bad
String = bad
But it also accepts a numbers with a space:
1, 2, 3, 4 = good
How to make regex that wouldn't allow to do so and would only let to enter a numbers, separated by a comma without spaces?