Hello, is anyone able to assist with a regex to validate a comma separated dialog element. It would be a comma separated list of integers/numbers, each numbers need to be 2 or 3 digits, not more than 5 numbers and the sum total of the numbers no more than 500.
So:
empty input is ok
10,20,30,40,50 is ok
100,20,20 is ok
10,2000 is bad (2000 is more than 3 digits)
5,10,300 is bad (5 is only one digit)
200,100,20,300 is bad (sum total is more than 500)
50,50,50,10,10,10 is bad (too many numbers more than 5)
I have tried ^\d{2,3}((,\d{2,3}){2,3})(\d{2,3})?$ and http://rubular.com/ but my regex experience is limited and I am not getting anywhere.
Thanks