I need a regular expression that will tell if a string is in the following format. The groups of numbers must be comma delimited. Can contain a range of numbers separated by a –
300, 200-400, 1, 250-300
The groups can be in any order.
This is what I have so far, but it’s not matching the entire string. It’s only matching the groups of numbers.
([0-9]{1,3}-?){1,2},?
1 Answer