how do i write the regex for a limited range repetition

Viewed 460

I am creating a form whereby the users can input a multi-value in a limited range I am having trouble repeating the range as shown below, do i have to validate the comma as well and can i have the full regular expression solution for this?

I am allowing the user to input the value multiple times for a limited range of 0-1000 for 64 times or less

the input can be as follow: 1000,0,100,123,10,23,56,654,981

and here's my current regular expression for the range (^(?:[0-9]|[1-9][0-9]|[1-9][0-9]{2}|1000)$)

1 Answers
Related