I am working on one input application where i need to test input values that accepts single, multiple and even a range of numbers .
Eg inputs : 70,900,80-20 // should return true as all are valid
as,@123 // should return false as it is not valid digit
12-123-12123-123123 // should also return false
I am trying to use this in regex. I have tried this.
/^[\d,\-{1}]+/
I am not able to test using this regex. Let me know where i am doing wrong
^\d+(-?\d+)?$/^\d+-?\d*$/