How about a named capture group:
(?<many>\d+(\-\d+)+)|(?<one>(?<=^|,)\d+(?=$|,))
Its basic usage is this:
Private Function GetPages(ByVal input As String) As List(of Integer)
Dim output as New List(of Integer)
Dim Number As String = "(?<many>\d+(\-\d+)+)|(?<one>(?<=^|,)\d+(?=$|,))"
For Each Match As Match In Regex.Matches(input, Number)
If Not Match.Groups("many").Value = String.Empty Then
dim temp() as string = Match.Groups("many").Value.ToString.Split("-")
For i as integer = temp(0) to temp(temp.count-1)
output.add(i)
next
ElseIf not Match.Groups("one").Value = String.Empty Then
Output.Add(Cint(Match.Groups("one").Value.ToString))
End If
Next
Return output
End Function
You can see more fanzy stuff with regex here:
Evaluate Complex and Real Math Calculator[
^]