I am having troble putting together a regex that .NET will evaluate to validate page ranges. The user can enter a set of page ranges to print in the form:
Here are some legal examples:
singletons are not allowed. These are invalid:
I tried this expression (\d-\d)([,]\d-\d)* but it is too greedy and things like 1-1, still match. Can anyone help me with a valid expression?